Skip to content
WebJs
Menu

registry.json

Schema for running your own component registry.

The registry.json schema is used to define your custom component registry. webjsui build reads it, inlines each item's files, and writes the JSON files the CLI fetches.

registry.json
{
  "name": "acme",
  "homepage": "https://acme.com",
  "items": [
    {
      "name": "hello-world",
      "type": "registry:block",
      "title": "Hello World",
      "description": "A simple hello world page.",
      "registryDependencies": ["brand-button"],
      "dependencies": ["[email protected]", "zod"],
      "files": [
        {
          "path": "blocks/hello-world/page.ts",
          "type": "registry:page",
          "target": "app/hello/page.ts"
        }
      ]
    }
  ]
}

Keep every item in the one registry.json. See Getting Started.

Definitions

The schema is registrySchema, exported from @webjsdev/ui/registry/schema. See the API Reference.

$schema

The $schema property is accepted and ignored. The CLI does not fetch or check it, so you can point it at a JSON Schema your editor understands or leave it out.

name

The name property is used to specify the name of your registry. It is required, and build copies it into the registry.json it writes.

registry.json
{
  "name": "acme"
}

homepage

The homepage of your registry. It is optional metadata. The directory links to the homepage its own entry for your registry names.

registry.json
{
  "homepage": "https://acme.com"
}

items

The items in your registry. Each item must implement the registry-item schema specification. items is required.

registry.json
{
  "items": [
    {
      "name": "hello-world",
      "type": "registry:block",
      "title": "Hello World",
      "description": "A simple hello world page.",
      "registryDependencies": ["brand-button"],
      "dependencies": ["[email protected]", "zod"],
      "files": [
        {
          "path": "blocks/hello-world/page.ts",
          "type": "registry:page",
          "target": "app/hello/page.ts"
        }
      ]
    }
  ]
}

Each file's path is read relative to registry.json. A file that already carries content is written as is, and build reads the file at path for every other one.

Item names must be unique, since each one becomes <name>.json in the output and a later item with the same name overwrites the earlier file.

See the registry-item schema documentation for more information.