@spoot/cn
v1.3.0
Published
Utility for merging Tailwind CSS class names with clsx and tailwind-merge
Downloads
236
Readme
@spoot/cn
Utility for merging Tailwind CSS class names using clsx and tailwind-merge.
Install
npm install @spoot/cnUsage
import { cn } from "@spoot/cn";
<div className={cn("px-4 py-2", isActive && "bg-blue-500", className)} />The cn function accepts any combination of strings, arrays, and objects (everything clsx supports), then passes the result through tailwind-merge to resolve conflicting Tailwind classes.
Development
pnpm typecheck # type-check
pnpm build:lib # compile to dist/