# Tailwind Variants

> A first-class variant API for Tailwind CSS

Source: https://talira.ai/catalog/tailwind-variants-82kre1qs
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [frontend / css / class variants](https://talira.ai/categories/frontend/css/class-variants)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source under MIT.
- Free tier: yes[^1]
- Self-hostable: yes[^2]
- Supports: [llms.txt](https://talira.ai/standards/llms-txt.md)[^3]
- Backed by: [HeroUI](https://talira.ai/orgs/heroui.md)

Tailwind Variants lets you define a component's [Tailwind CSS](https://talira.ai/catalog/tailwind-css-wfchsr5n.md) classes once as a recipe (base classes, variants such as colour and size, default variants and compound variants that apply only to certain combinations) and call it anywhere with typed props, instead of building long class strings by hand. Slots style each part of a multi-part component from one recipe, `extend` composes recipes into new ones, and the default build resolves conflicting Tailwind classes itself, while a lite build skips that or takes a merge function you already use. It works with any framework, infers TypeScript props with `VariantProps`, and is made by HeroUI; its docs compare it with Class Variance Authority and serve llms.txt and a docs MCP server.

## Links

- Website: https://www.tailwind-variants.org/
- GitHub: https://github.com/heroui-inc/tailwind-variants
- Docs: https://www.tailwind-variants.org/docs/introduction

## Problems it solves

- our button component has a mess of conditional Tailwind class strings for every colour and size
- define size and colour variants for a component once and get typed props for them
- apply extra classes only when two variants combine, like a large primary button
- style each part of a multi-part component, like a card's header and body, from one place
- conflicting Tailwind classes from overrides end up both applied and the wrong one wins
- extend a base component's styles into a new component without copying class lists
- Stitches-style variants for a design system built on Tailwind

## Features

- variants, default variants and compound variants for Tailwind classes
- slots for multi-part components
- extend and compose recipes
- built-in conflict resolution for Tailwind classes, or a lite build without it
- typed props inferred with VariantProps
- responsive classes with breakpoint prefixes
- global configuration for design system defaults
- framework-agnostic: works with any UI framework
- llms.txt and a Streamable HTTP MCP server for its docs

## Trust

Overall: 0.27 out of 1.
Signals: backing 0.30, extensibility 0.00.

- backed by HeroUI

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Class Variance Authority](https://talira.ai/catalog/class-variance-authority-x7mgegwq.md): A tiny library for building type-safe, variant-driven class names with Tailwind CSS or any other styling approach

## Sources

[^1]: https://github.com/heroui-inc/tailwind-variants/blob/main/LICENSE (checked 22 Nov 2026)
[^2]: https://www.tailwind-variants.org/ (checked 22 Nov 2026)
[^3]: https://www.tailwind-variants.org/docs/llms-txt (checked 22 Nov 2026)
