Configuration
registry.json
Structure and usage of the registry.json file in Zeta, following the official shadcn/ui schema.
What is registry.json
?
The registry.json
file is the heart of your component registry in Zeta. It defines the metadata, dependencies, and items (components, blocks, hooks, etc.) that make up your registry.
Important
This file follows the official shadcn/ui schema, ensuring compatibility and portability.
General Structure
- $schema: URL to the official schema, enables validation and autocompletion.
- name: Unique name for your registry.
- description: Short description of your registry.
- homepage: Main URL or demo.
- items: Array of items, each following the official item schema.
Items and Dependencies
Each item can be a component, block, hook, etc.
The most important fields are:
- name: Unique name for the item.
- type: Type (
registry:block
,registry:component
, etc.). - title: Human-readable title.
- description: Short description.
- author: Author of the item.
- dependencies: NPM packages required for this item (priority).
- registryDependencies: Other registry items or URLs of external registries.
Tip
- Use
dependencies
to declare all required NPM packages (e.g.,shadcn
,lucide-react
,zod
, etc.). - Use
registryDependencies
to reference shadcn/ui components or external blocks.
Real Example
- dependencies: All NPM packages required for the block to work properly.
- registryDependencies: shadcn/ui components or blocks used internally by this block.
Best Practices
- Always use the official schema for validation and compatibility.
- Declare all dependencies explicitly.
- Keep names and descriptions clear and unique.
- Update dependencies regularly to avoid vulnerabilities.