用途:把 8-bit 组件登记到 registry.json,使其可通过 shadcn add @8bitcn/[component-name] 被发现和安装,适用于向组件库分发中添加新组件。
主要能力:支持两种条目类型。registry:component 用于单个可复用组件;registry:block 用于预构建布局或功能(如游戏 UI),可带 categories。条目字段包括 name、type、title、description、registryDependencies、files,block 还可含 categories。
必要用法:files 数组中必须始终包含 retro.css,且组件文件在前、retro.css 在后;source 与 target 路径相同。registryDependencies 只列基础 shadcn/ui 组件(非 8-bit 版本)。游戏类组件使用 categories: ["gaming"],可用分类有 gaming、layout、form、data-display、feedback、navigation、overlay。新增组件流程:在 components/ui/8bit/component.tsx 创建组件,在 content/docs/components/component.mdx 创建文档,复制现有条目为模板并更新 name、title、description,设置正确的 registryDependencies,包含 retro.css,然后测试:pnpm dlx shadcn@latest add @8bitcn/component。
限制:资料未提供其他安装方式、版本要求或收费信息。