shadcn-ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseshadcn/ui
shadcn/ui
shadcn/ui is a collection of accessible, composable React components built on Radix UI primitives and styled with Tailwind CSS — components are copied into your project via CLI, giving you full ownership of the source code.
shadcn/ui是一组基于Radix UI基础组件、采用Tailwind CSS样式的可访问、可组合React组件集——组件可通过CLI复制到你的项目中,让你完全拥有源代码的所有权。
Documentation
文档
Best Practices
最佳实践
- Form components include React Hook Form and Zod — do not add separate form libraries. The component wraps
Formwith built-in Zod validation. Addingreact-hook-form,formik, or additional validation packages is redundant.react-final-form - controls path aliases, Tailwind config, and component style — always check this file exists and is correctly configured before adding components. An incorrect
components.jsonpath or missing CSS variable setup intailwind.configcauses components to render without styles.globals.css - There is no "update all" command — and
shadcn addoperate per-component. When suggesting upgrades, list each component individually; bulk update scripts must be written manually.shadcn diff
- 表单组件已包含React Hook Form和Zod——请勿添加独立的表单库。 组件封装了
Form并内置Zod验证。添加react-hook-form、formik或其他验证包属于冗余操作。react-final-form - 控制路径别名、Tailwind配置和组件样式 ——在添加组件前,请务必确认该文件存在且配置正确。
components.json路径错误或tailwind.config中缺少CSS变量设置会导致组件无样式渲染。globals.css - 没有「全部更新」命令 ——和
shadcn add按单个组件操作。建议升级时,请逐个列出组件;批量更新脚本需要手动编写。shadcn diff