shadcn-ui/cn
cn is a new engine for Tailwind class merging and conflict resolution. It replaces tailwind-merge and clsx. Same APIs. Full parity. And it is 30× faster.
Older snapshot: check the original source for current information.
From the publisher
README & documentation
Source previewRead the project’s overview, installation instructions and usage examples. The original README is the source of truth.
cn is a new engine for Tailwind class merging and conflict resolution. It replaces tailwind-merge and clsx. Same APIs. Full parity. And it is 30× faster. cn has zero dependencies and is framework-agnostic: it works with React, Vue, Svelte, Solid, Astro, or plain server templates, and runs in browsers, Node, Bun, Deno, and edge runtimes. It works in any Tailwind CSS project. You don't need shadcn/ui. If you want an even smaller bundle with the same performance, see cn build. cn is built and maintained by aidenybai and shadcn. Yes. You can replace tailwind-merge and clsx with cn today. It's a drop-in replacement. Here's a command to migrate: Import it and go. Nothing to configure: Your components already import cn from @/lib/utils. Replace the wrapper with the one from cn. Then remove clsx and tailwind-merge from your dependencies. If other packages still import them, alias them to cn so your…
Read the full README ↗ · Preview checked 2026-10-29T23:29:25.029Z
Inside the original README — Document outline
- cn
- Can I use this today?
- Install
- New project
- Existing shadcn/ui project
- Using the shadcn CLI
- Manually
- How much faster?
- Real repositories
- Custom themes
- Coming from tailwind-merge
- Gotchas
Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.
Links from the README
References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.
Documentation belongs to its respective authors. Reported project/model license: MIT. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.
What this repository does
cn is a new engine for Tailwind class merging and conflict resolution. It replaces tailwind-merge and clsx. Same APIs. Full parity. And it is 30× faster.
Repository facts
- Owner
- shadcn-ui
- Primary language
- TypeScript
- Stars
- 1,613
- Forks
- 17
- Open issues + pull requests
- 6
- License
- MIT
- Archived
- No
- Default branch
- main
- Created
- 2026-08-31T07:04:03.000Z
- Last push
- 2026-09-28T12:32:43.000Z
Topics and intended use
Owner-supplied topics: clsx, cn, shadcn, tailwind-merge, tailwindcss
Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.
Evaluate before installing
Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.
Source and freshness
Source: GitHub. Metadata observed 2026-09-30T12:05:19.009Z. Daily imports are snapshots, not real-time monitoring.
Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.