What happened
cn is a new library from aidenybai and shadcn that replaces the standard pairing of clsx and tailwind-merge — conditional class joining plus Tailwind conflict resolution — behind the same API.
It has zero dependencies, is framework-agnostic across React, Vue, Svelte, Solid, Astro and plain server templates, runs in browsers, Node, Bun, Deno and edge runtimes, works in any Tailwind project without shadcn/ui, and ships 26 KB minified. Migration is a single command, npx shadcn@latest migrate cn. The repository was created on August 31, 2026 and has drawn 1,161 stars in under a week under an MIT licence.
Why it matters
clsx and tailwind-merge are close to universal in Tailwind codebases, which makes a drop-in replacement with a migration script an unusually low-risk thing to evaluate — the failure mode is git revert, not a rewrite.
The benchmark disclosure is also better than the category norm: isolated processes per library, explicit warmup, best of five runs, a documented methodology, a reproducible pnpm bench, and a corpus replay of 144,265 real calls harvested from 58 open source repositories rather than a synthetic loop the author chose. Publishing the rows where the win is small is the part most vendor benchmarks omit.
But, but, but…
Verdict: try — but calibrate the headline. The 30× is one scenario, the common component call, moving 320 ns to 10 ns; the same table reports 1.9× on cache hits and 1.9× on warm typical strings, which is what a steady-state render actually does a lot of.
The eye-catching 172× applies to a recurring working set, and the corpus geometric mean of 37× is dominated by whichever repositories exercise that path. In absolute terms the meaningful line is cold start: 3.2 ms down to 0.4 ms at first call. That is worth having and it is not what "30× faster" makes most readers picture. It is also a six-day-old library with five open issues in the dependency position that every component in your codebase imports.
“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.”
— Dr Non
The counter-take
A 30× speedup on an operation costing 320 nanoseconds is a real engineering result and an almost invisible user-facing one. The number worth caring about is 3.2 ms to 0.4 ms on first call at page load — a single-digit millisecond saved once — and that is a far less exciting sentence than the one on the README.
The AI angle
null
