Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
开源注册库索引列出了所有开箱即用、可供使用的开源注册库。
当你运行 shadcn add 或 shadcn search 时,CLI 会自动在注册库索引中查找你需要的注册库,并将其添加到你的 components.json 文件中。
你可以在 https://ui.shadcn.com/r/registries.json 查看完整列表。
添加注册库
- 将你的注册库添加到
apps/v4/registry/directory.json - 运行
pnpm registry:build来更新registries.json文件。 - 向 https://github.com/shadcn-ui/ui 提交一个 pull request
当你提交请求后,团队会对其进行校验和审核。
要求
- 注册库必须是开源且可公开访问的。
- 注册库必须是一个有效的 JSON 文件,并符合 registry schema 规范。
- 注册库应当是扁平结构,不包含嵌套条目,也就是说,
/registry.json和/component-name.json文件应该位于注册库根目录。 - 如果存在
files数组,则其中不得包含content属性。
下面是一个有效注册库的示例:
{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "acme",
"homepage": "https://acme.com",
"items": [
{
"name": "login-form",
"type": "registry:component",
"title": "Login Form",
"description": "A login form component.",
"files": [
{
"path": "registry/new-york/auth/login-form.tsx",
"type": "registry:component"
}
]
},
{
"name": "example-login-form",
"type": "registry:component",
"title": "Example Login Form",
"description": "An example showing how to use the login form component.",
"files": [
{
"path": "registry/new-york/examples/example-login-form.tsx",
"type": "registry:component"
}
]
}
]
}