Skip to main content

Reuse for Tailwind CSSs

Reuse in Tailwind CSS is how repeated utility patterns are kept maintainable. The recommended approach is to extract components in your framework, such as a React or Vue Button, rather than copying long class lists. Other tools include @apply for small shared styles and libraries like class-variance-authority for variants, plus common patterns for cards, forms and navbars.

Stage: Customisation · Part of the Tailwind CSS roadmap · Last reviewed 19 November 2026

What to learn in Reuse

Reuse interview questions

Why do Tailwind docs prefer components over @apply?

A component encapsulates markup and styles together, so you reuse structure, not just class names, and each change happens in one place. @apply recreates traditional CSS, adding naming and ordering concerns. It is still fine for small things like styling rendered Markdown.

What problem does tailwind-merge solve?

When a component accepts a className prop, two utilities that set the same property, such as p-2 and p-4, may both appear, and the winner depends on CSS order, not class order. tailwind-merge removes the conflicting earlier class so the caller's override works predictably.

Where Reuse fits in the Tailwind CSS roadmap

Reuse belongs to the Customisation stage (beginner level). Make it yours.

Back to the full Tailwind CSS roadmap