For developers

Class merging (cn)

The cn function: merge Tailwind classes without conflicts

npx shadcn@latest add @umbra/cn

Requires clsx and tailwind-merge: every shadcn project has them. The registry doesn’t install them on purpose, so it won’t bump tailwind-merge to 3 in a Tailwind 3.4 project (that needs 2)

The regular cn from shadcn doesn’t know the token classes and merges text-label and text-muted into one group: one class gets lost. The Umbra cn knows the token groups. Works with tailwind-merge 2 (Tailwind 3.4) and 3 (Tailwind 4)

When to use

Installed automatically with any component. Manually: if you build your own product component from Umbra classes

When not to use

It doesn’t replace the product’s @/lib/utils: that one stays for shadcn components

This item has no live example: it installs files or rules. See the “Code” tab to set it up