Registry
Cubix distributes components as a flat-file registry. JSON items describe source files and dependencies; the CLI copies them into your project. You can consume the Cubix catalog or publish your own.
A registry is any HTTP endpoint that serves schema-valid JSON - a Next.js public/r folder, a static host, or your own API. The Cubix docs site itself ships the official catalog from public/r.
- Catalog -
index.json(orregistry.json) lists every item. - Items - one JSON file per component, for example
button.json. - CLI -
cubix add,view,search, andbuildspeak this format.
Catalog schema
The catalog is the registry entry point. Cubix uses https://cubix.design/schema/registry.json:
{
"$schema": "https://cubix.design/schema/registry.json",
"name": "cubix",
"homepage": "https://cubix.design",
"items": [
{
"name": "button",
"type": "registry:ui",
"title": "Button",
"description": "Displays a button or a component that looks like a button.",
"files": [
{
"path": "public/r/button.json",
"type": "registry:ui"
}
]
}
]
}Required fields: name, homepage, and items. Each catalog entry points at the published item JSON the CLI will fetch.
Item schema
Each component is a registry item. Schema: https://cubix.design/schema/registry-item.json.
{
"$schema": "https://cubix.design/schema/registry-item.json",
"name": "button",
"type": "registry:ui",
"title": "Button",
"description": "Displays a button or a component that looks like a button.",
"dependencies": ["@base-ui/react"],
"registryDependencies": [],
"files": [
{
"path": "components/cubix/button.tsx",
"type": "registry:ui",
"target": "components/cubix/button.tsx"
}
]
}| Field | Required | Description |
|---|---|---|
| name | Yes | Stable id used by the CLI (button, prompt-input). |
| type | Yes | Item kind, usually registry:ui for Cubix components. |
| title | No | Human-readable label shown in docs and search. |
| description | No | Short summary for humans and AI assistants. |
| dependencies | No | npm packages to install (for example @base-ui/react). |
| registryDependencies | No | Other registry items that must be installed first. |
| files | Yes | Source files with path, type, and optional target. |
When an item needs other Cubix pieces and npm packages, list both:
{
"$schema": "https://cubix.design/schema/registry-item.json",
"name": "date-picker",
"type": "registry:ui",
"title": "Date Picker",
"description": "A date picker component with range and presets.",
"dependencies": ["date-fns", "chrono-node"],
"registryDependencies": [
"button",
"calendar",
"popover",
"input",
"input-group"
],
"files": [
{
"path": "components/cubix/date-picker.tsx",
"type": "registry:ui",
"target": "components/cubix/date-picker.tsx"
}
]
}Item types
Cubix primarily ships registry:ui items. The schema also supports related kinds for larger catalogs:
| Type | Description |
|---|---|
| registry:ui | Reusable UI primitives under components/cubix. |
| registry:component | Composed components that are not core primitives. |
| registry:block | Larger page or section templates (chat shells, 404s). |
| registry:hook | Shared React hooks. |
| registry:lib | Utilities and helpers (for example path aliases under lib). |
| registry:style | CSS tokens or style fragments for the design system. |
Build and serve
Author a source registry.json, then generate static files with the CLI. Output defaults to public/r:
pnpm dlx cubix@latest buildOn Next.js, those files are served as /r/button.json, /r/index.json, and so on. Any host that serves static JSON works the same way. Full build flags are on the CLI page.
Consume a registry
After Installation, add components by name from the configured Cubix registry:
pnpm dlx cubix@latest add buttonOr pass a full item URL:
pnpm dlx cubix@latest add https://cubix.design/r/button.jsonInspect before install:
pnpm dlx cubix@latest view buttonpnpm dlx cubix@latest search -q "dialog"Namespaces
Map a short namespace to a URL template in cubix.json. {name} is replaced with the item id:
{
"registries": {
"@cubix": "https://cubix.design/r/{name}.json"
}
}Custom registries work the same way:
{
"registries": {
"@acme": "https://acme.com/r/{name}.json"
}
}pnpm dlx cubix@latest add @acme/buttonPublish your own
To distribute internal components with the same CLI flow:
- Keep source under paths your consumers expect (Cubix uses
components/cubix). - Define a root catalog that conforms to the Cubix registry schema:
{
"$schema": "https://cubix.design/schema/registry.json",
"name": "acme",
"homepage": "https://acme.com",
"items": [
{
"name": "button",
"type": "registry:ui",
"title": "Button",
"description": "A simple button component.",
"files": [
{
"path": "components/cubix/button.tsx",
"type": "registry:ui"
}
]
}
]
}- Run
cubix buildand deploy the output directory. - Share the namespace URL template so teams can
cubix add @acme/button.
Authoring guidelines
- Give every item a clear
titleanddescription- humans and Skills both rely on them. - List all npm packages in
dependenciesand all Cubix peers inregistryDependencies. - Set
files[].targetto the path consumers should receive afteradd. - Keep the visual API aligned across Base UI, React Aria, and Radix when you publish base variants.
- Prefer Cubix tokens only - never ship hardcoded brand colors in registry source.
- Update the catalog whenever you add or rename an item so
searchstays accurate.
Next: CLI, Skills, or browse Components.