cntw
v1.0.1
Published
A simple JavaScript utility for conditionally joining Tailwind CSS classes together.
Downloads
3
Maintainers
Readme
cntw (classnames + tailwind-merge)
A simple JavaScript utility for conditionally joining Tailwind CSS classes together.
Installation
pnpm add cntw
Usage
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>
);
}