惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
WordPress大学
WordPress大学
爱范儿
爱范儿
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
博客园_首页
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
MyScale Blog
MyScale Blog
IT之家
IT之家
H
Help Net Security
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理

shadcn/ui Changelog

August 2026 - Private GitHub Registries August 2026 - Human in the Loop August 2026 - Questionnaire July 2026 - Dynamic Search July 2026 - Toast July 2026 - React Aria July 2026 - Introducing @shadcn/helpers July 2026 - Introducing shadcn/typeset July 2026 - Base UI as the Default June 2026 - Components for Chat Interfaces June 2026 - GitHub Registries May 2026 - shadcn eject May 2026 - Introducing Rhea May 2026 - Registry Include and Validate May 2026 - Package Imports and Target Aliases April 2026 - shadcn preset April 2026 - Pointer Cursor April 2026 - Partial Preset Apply April 2026 - Introducing Sera April 2026 - shadcn apply April 2026 - Component Composition March 2026 - Introducing Luma March 2026 - shadcn/cli v4 February 2026 - Blocks for Radix and Base UI February 2026 - Unified Radix UI Package January 2026 - RTL Support January 2026 - Inline Start and End Styles January 2026 - Base UI Documentation December 2025 - npx shadcn create October 2025 - Registry Directory
September 2026 - cn
shadcn · 2026-09-03 · via shadcn/ui Changelog

Components now import cn from the cn package. One dependency instead of two, and no local helper to maintain.

Every shadcn component now imports cn from the cn package.

For years, every shadcn project started with the same five lines in lib/utils.ts: import clsx, import twMerge, wrap one in the other, export it as cn. It worked, but it meant two dependencies and a helper you had to copy into every project and every registry.

We have moved that into a package. cn is a drop-in replacement for twMerge(clsx(...)). It is smaller, faster and ships the same API, so nothing changes at the call site.

import { cn } from "cn"
 
;<div className={cn("flex items-center", className)} />

What changed

  • Registry components, blocks and examples import cn from cn instead of @/lib/utils.
  • npx shadcn init installs cn and generates a one-line lib/utils.ts.
  • Every registry item that uses cn declares it as a dependency, so npx shadcn add installs it in projects created before this change.

lib/utils.ts

The utils registry item still exists. It now re-exports cn so your own code keeps working and you still have a single place for project helpers.

lib/utils.ts
export { cn } from "cn"

Existing projects

Nothing breaks. Your lib/utils.ts keeps working and new components install cn next to it. To move the rest of your project over and drop clsx and tailwind-merge, run the migration:

It rewrites imports, replaces twMerge(clsx(...)) calls and removes the old packages when nothing references them anymore. See the CLI docs for details.