# registry.json

Schema for running your own component registry.

Source: https://webjs.dev/ui/docs/registry/registry-json

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.

```json title="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": ["is-even@3.0.0", "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](https://webjs.dev/ui/docs/registry/getting-started).

## Definitions

The schema is `registrySchema`, exported from `@webjsdev/ui/registry/schema`. See the [API Reference](https://webjs.dev/ui/docs/registry/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.

```json title="registry.json"
{
  "name": "acme"
}
```

### homepage

The homepage of your registry. It is optional metadata. The [directory](https://webjs.dev/ui/docs/directory) links to the homepage its own entry for your registry names.

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

### items

The `items` in your registry. Each item must implement the [registry-item schema specification](https://webjs.dev/ui/docs/registry/registry-item-json). `items` is required.

```json title="registry.json"
{
  "items": [
    {
      "name": "hello-world",
      "type": "registry:block",
      "title": "Hello World",
      "description": "A simple hello world page.",
      "registryDependencies": ["brand-button"],
      "dependencies": ["is-even@3.0.0", "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](https://webjs.dev/ui/docs/registry/registry-item-json) for more information.
