cn
A utility function to merge Tailwind class names using clsx
and tailwind-merge
. Use this library to write conditional classes in your components.
Import
Parameters
cn
accepts a single parameter, which can be a string, an object, or a conditional statement.
Usage
Simple
Conditional logic
With an object
Returns
A string of merged class names.