tailwind-variants

Generate typed Tailwind CSS variant classes with the tv() function.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/oversio/personal-finances --skill tailwind-variants
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwind-variants
Source: https://github.com/oversio/personal-finances/tree/main/skills/tailwind-variants
Command: npx skills add https://github.com/oversio/personal-finances --skill tailwind-variants

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tailwind-variants provides a structured approach to manage complex Tailwind CSS class variants, enabling consistent design systems and reusable components across a project.

Core Features & Use Cases

  • Variant definitions with tv() to model color, size, state, and more.
  • Slots pattern support for multi-part components (base, header, body, footer).
  • Compound variants and defaulting for predictable UI outcomes.
  • TypeScript integration for typed variant props and strong editor support.
  • Ideal for design-system driven frontend work in React and other frameworks.

Quick Start

Install the package with npm or yarn, then start defining variant sets in a .variants.ts file and use the generated variant hooks/classes in your components.

Frequently Asked Questions about tailwind-variants

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

FAQPage Schema
How do I manage complex conditional Tailwind CSS classes for reusable React components?

You can manage complex conditional Tailwind CSS classes by defining props-based styling, multi-part components, and compound variants using a declarative API to generate predictable UI variant classes.

What is the best way to structure multi-part component variants in a design system?

Structuring multi-part component variants in a design system is achieved using a slots pattern that models distinct parts like base, header, body, and footer to ensure consistent styling across reusable components.

Does Tailwind-variants provide TypeScript support for typed variant props?

Tailwind-variants provides TypeScript integration for typed variant props, offering strong editor support and a TypeScript-friendly API to model component states like color and size.

How do I define compound variants for predictable UI outcomes in TypeScript?

Defining compound variants for predictable UI outcomes involves using a declarative workflow to generate variant classes, allowing you to combine multiple prop conditions and set default styling configurations.

Can I use tailwind-variants for design-system-driven frontend work without additional dependencies?

Yes, you can use it for design-system-driven frontend work in React and TypeScript projects without external dependencies, defining variant sets in a dedicated file and applying the generated classes directly.