A simple JavaScript utility for conditionally joining Tailwind CSS classes together.
pnpm add cntw
import { cn } from "cntw";
export default function ButtonExample() {
const disabled = true;
return (
<button
className={cn(
"rounded-md bg-green-500 px-4 py-2 font-bold text-white",
disabled && "bg-red-500"
)}
>
Click me
</button>
);
}