component-builder
Create UI components using tailwind-variants for type-safe styling. Use when creating or editing components in src/lib/ui/.
Install
mkdir -p .claude/skills/component-builder && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7669" && unzip -o skill.zip -d .claude/skills/component-builder && rm skill.zipInstalls to .claude/skills/component-builder
About this skill
Component Builder
This skill documents the tailwind-variants pattern used for UI components in this project. All UI components should follow this pattern for consistency and type safety.
When to Use
Use this skill when:
- Creating new UI components in
src/lib/ui/ - Refactoring existing components to use tailwind-variants
- Adding new variants to existing components
Quick Start
Every component needs two files:
componentName.variants.ts- Variant definitionsComponentName.svelte- The component
Reference Files
- Canonical example:
src/lib/ui/Button.svelteandsrc/lib/ui/button.variants.ts - Compound variants example:
src/lib/ui/Tag.svelteandsrc/lib/ui/tag.variants.ts - Multi-variant example:
src/lib/ui/ContentCard.svelteandsrc/lib/ui/contentCard.variants.ts
Pattern Overview
Step 1: Create Variants File
// componentName.variants.ts
import { tv, type VariantProps } from 'tailwind-variants'
export const componentVariants = tv({
base: 'common-classes-for-all-variants',
variants: {
variant: {
primary: 'classes-for-primary',
secondary: 'classes-for-secondary'
},
size: {
sm: 'text-sm px-2',
md: 'text-base px-4',
lg: 'text-lg px-6'
}
},
defaultVariants: {
variant: 'primary',
size: 'md'
}
})
// Export types for each variant dimension
export type ComponentVariant = VariantProps<typeof componentVariants>['variant']
export type ComponentSize = VariantProps<typeof componentVariants>['size']
Step 2: Use in Component
<script lang="ts">
import type { ClassValue } from 'svelte/elements'
import { componentVariants, type ComponentVariant, type ComponentSize } from './componentName.variants'
type Props = {
variant?: ComponentVariant
size?: ComponentSize
class?: ClassValue
}
let { variant, size, class: className, ...rest }: Props = $props()
</script>
<div class={[componentVariants({ variant, size }), className]} {...rest}>
<!-- content -->
</div>
Key Patterns
Boolean Variants
For on/off states like active, disabled, error:
variants: {
active: {
true: 'bg-svelte-100 border-svelte-300',
false: ''
},
error: {
true: 'border-red-300 bg-red-50',
false: 'border-transparent'
}
}
Compound Variants
Apply styles only when specific combinations match:
compoundVariants: [
{
active: true,
removable: false,
class: 'hover:bg-svelte-200'
}
]
Class Merging
Always use array syntax to allow consumer overrides:
<div class={[componentVariants({ variant, size }), className]}>
Templates
For copy-paste templates, see TEMPLATES.md.
More by svelte-society
View all skills by svelte-society →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversCreate modern React UI components instantly with Magic AI Agent. Integrates with top IDEs for fast, stunning design and
Connect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
Effortlessly create 25+ chart types with MCP Server Chart. Visualize complex datasets using TypeScript and AntV for powe
Integrate with Google Sheets and Google Drive to manage spreadsheets easily using the Google Sheets API and advanced aut
Automate Notion documentation with seamless Notion API integration. Manage pages and blocks efficiently using Node.js fo
Quickly rp prototype web apps with Scaffold Generator: create consistent scaffolding using templates, variable substitut
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.