formsTailwind
cn() Utility Pattern
SHOULD
SHOULD: Create cn() utility combining clsx + tailwind-merge for conditional class merging
Create a cn() utility combining clsx and tailwind-merge
Bad
Good
Why it matters
The cn() utility is a standard pattern that combines clsx (for conditional class logic) with tailwind-merge (for conflict resolution). This provides the best of both worlds for component styling.
References