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

推荐订阅源

Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
L
LangChain Blog
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
D
DataBreaches.Net
P
Proofpoint News Feed
小众软件
小众软件
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
雷峰网
雷峰网
G
Google Developers 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.