组件
registry.json
模式用于定义您的自定义组件注册表。
{
"$schema": "https://ui.shadcn.org.cn/schema/registry.json",
"name": "shadcn",
"homepage": "https://ui.shadcn.org.cn",
"items": [
{
"name": "hello-world",
"type": "registry:block",
"title": "Hello World",
"description": "A simple hello world component.",
"files": [
{
"path": "registry/new-york/hello-world/hello-world.tsx",
"type": "registry:component"
}
]
}
]
}
定义
您可以在此处查看 registry.json
的 JSON 模式。
$schema
$schema
属性用于指定 registry.json
文件的模式。
{
"$schema": "https://ui.shadcn.org.cn/schema/registry.json"
}
name
name
属性用于指定您的注册表的名称。这用于数据属性和其他元数据。
{
"name": "acme"
}
homepage
您的注册表主页。这用于数据属性和其他元数据。
{
"homepage": "https://acme.com"
}
items
注册表中的items
。每个项目必须实现 registry-item 模式规范。
{
"items": [
{
"name": "hello-world",
"type": "registry:block",
"title": "Hello World",
"description": "A simple hello world component.",
"files": [
{
"path": "registry/new-york/hello-world/hello-world.tsx",
"type": "registry:component"
}
]
}
]
}
有关更多信息,请参阅registry-item 模式文档。