component-builder

Create type-safe UI components with tailwind-variants in TypeScript files.

2|1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/zajca/zfaktury --skill component-builder-zajca
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-builder
Source: https://github.com/zajca/zfaktury/tree/main/.agents/skills/component-builder
Command: npx skills add https://github.com/zajca/zfaktury --skill component-builder-zajca

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill standardizes the creation of UI components by enforcing a type-safe styling pattern using tailwind-variants, ensuring consistency and maintainability in the project's frontend.

Core Features & Use Cases

  • Variant Definitions: Define reusable styling variations for components (e.g., primary, secondary, sm, md).
  • Type Safety: Ensures that component props and their corresponding styles are correctly typed, preventing runtime errors.
  • Use Case: When creating a new Card component, use this skill to define its variant (e.g., default, elevated) and padding (e.g., sm, md) properties, ensuring all instances of Card are styled predictably.

Quick Start

Use the component-builder skill to create a new UI component by defining its variants in a componentName.variants.ts file and then using those variants within the ComponentName.svelte file.

Frequently Asked Questions about component-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe UI components with tailwind-variants?

You build type-safe UI components by defining base classes, variant props, and compound variants in dedicated TypeScript files, ensuring consistent styling for reusable frontend elements within the `src/lib/ui/` directory.

What is the best way to standardize Svelte component styling across a project?

Standardizing Svelte component styling involves enforcing a type-safe pattern using `tailwind-variants`, ensuring maintainability by defining reusable styling variations like `primary` or `secondary` in dedicated variant files.

How does defining variants in separate TypeScript files improve frontend development?

Defining variants in separate TypeScript files improves frontend development by ensuring component props and styles are correctly typed, preventing runtime errors and making styling variations predictable across all component instances.

Can I use this approach to define complex styling logic for Svelte components?

Yes, you can use this approach to support complex styling logic for reusable frontend elements by defining base classes, variant props, and compound variants in dedicated TypeScript files.

When do I need to create a dedicated variants file for a UI component?

You need to create a dedicated variants file when creating a new UI component like a `Card`, allowing you to define its variant and padding properties to ensure all instances are styled predictably.

How do I apply defined tailwind-variants to a Svelte component file?

You apply defined tailwind-variants by creating a `componentName.variants.ts` file to establish the styling variations, then importing and using those variants within the corresponding `ComponentName.svelte` file.