🌐 Nodejs.cn

2026年1月 - 基础用户界面文档

Base UI 组件的完整文档。

我们已经发布了 Base UI 组件的完整文档。

🌐 We've shipped full documentation for Base UI components.

当我们在十二月推出 npx shadcn create 时,我们引入了在 Radix 和 Base UI 之间选择作为你的组件库的功能。今天,我们发布了所有 Base UI 组件的完整文档。

🌐 When we launched npx shadcn create in December, we introduced the ability to choose between Radix and Base UI as your component library. Today, we're following up with complete documentation for all Base UI components.

有什么新东西

🌐 What's New

  • 完整的基础 UI 文档 - 每个组件现在都有专门的基础 UI 文档,涵盖使用方法、属性和示例。
  • 重建示例 - 所有组件示例都已为 Radix 和 Base UI 重新构建。切换它们以查看实现差异。
  • 并排比较 - 文档让比较两个库中组件的工作方式变得容易。

相同的抽象,不同的原语

🌐 Same Abstraction, Different Primitives

目标保持不变:无论你选择哪种基础库,都为你提供一致的 API。组件的外观和行为相同。只有底层实现发生变化。

🌐 The goal remains the same: give you a consistent API regardless of which primitive library you choose. The components look and behave the same way. Only the underlying implementation changes.

// Works the same whether you're using Radix or Base UI.
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog"

如果你正在开始一个新项目,运行 npx shadcn create 并选择你偏好的库。CLI 会处理其余部分。

🌐 If you're starting a new project, run npx shadcn create and pick your preferred library. The CLI handles the rest.

尝试 shadcn/create