shadcn and aidenybai open-source cn, a 30x faster Tailwind class merge engine
In early September, shadcn (creator of shadcn/ui) and aidenybai (creator of Million.js) open-sourced cn, a new engine for Tailwind class merging and conflict resolution, positioned as a drop-in replacement for tailwind-merge and clsx. Official benchmarks claim a 30x speedup over tailwind-merge, with a fully aligned API for painless migration.
Confirmed
- cn was developed and open-sourced by shadcn and aidenybai; shadcn announced it himself on September 2, followed by aidenybai and multiple community authors.
- It is a drop-in replacement for tailwind-merge and clsx with an identical, fully aligned API.
- It works with all frameworks and runs in any environment.
- Output is identical to the originals, with a smaller bundle size.
- Official benchmarks report a 30x speed improvement over tailwind-merge.
Why it matters
tailwind-merge and clsx are the de facto standard for class merging in the React/Tailwind ecosystem, underpinning nearly every Tailwind-based component library. By offering order-of-magnitude performance gains and a smaller footprint with the same API, cn allows existing projects to switch at near-zero cost — especially valuable for large UI libraries with frequent re-renders and heavy class computation. With shadcn himself optimizing this foundational layer, the ecosystem may gradually migrate to the new solution.
2026-09-02 ~ 2026-09-03 · 5 related posts
Primary sources
- [source] shadcn open-sources cn, a drop-in tailwind-merge/clsx replacement that's 30x faster — shadcn · 2026-09-02
4 near-duplicate retellings: shadcn · aidenybai · stramel89 · SeyoneC