# Registry Directory

Open Source Registry Index

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

The open source registry index is a list of the open source registries you can install from with the WebJs UI CLI.

The [Directory](https://webjs.dev/ui/docs/directory) page lists them, and each entry shows the command that installs from that registry. The CLI installs from the registry its `--registry` flag names, and from the WebJs UI registry when there is no flag.

You can see the full list at [/ui/r/registries.json](https://webjs.dev/ui/r/registries.json).

You do not need to submit a registry to the directory to use it. Any registry URL works with `--registry`. The directory is for registries you want other people to find.

## Adding a Registry

1. Add your registry to [`website/modules/ui/directory/registries.ts`](https://github.com/webjsdev/webjs/blob/main/website/modules/ui/directory/registries.ts): its `name`, `homepage`, base `url`, a one-line `description`, and a square SVG `logo` drawn with `var(--foreground)`.
2. Check that the CLI can list and install from the `url` you entered.
3. Create a pull request to [https://github.com/webjsdev/webjs](https://github.com/webjsdev/webjs).

```ts title="website/modules/ui/directory/registries.ts"
{
  name: '@acme',
  homepage: 'https://acme.com',
  url: 'https://acme.com/r',
  description: 'Acme components for WebJs apps.',
  logo: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='var(--foreground)'>...</svg>",
},
```

```bash
npx @webjsdev/ui list --registry https://acme.com/r
```

Once you have submitted your request, it will be reviewed. Once the pull request is merged, your registry appears in the directory with the next deploy of webjs.dev. An entry stays listed until someone changes the file.

## Requirements

1. The registry must be open source and publicly accessible, with no authentication.
2. Every item must be valid JSON that conforms to the [registry-item schema specification](https://webjs.dev/ui/docs/registry/registry-item-json).
3. The registry is expected to be a flat registry with no nested items, i.e. `<url>/index.json` and `<url>/component-name.json` files are expected at the root of the registry's base URL.
4. Each file in an item's `files` array MUST include its `content`. The CLI writes a file from that string and never fetches a file by its `path`. `webjsui build` inlines it for you.

Here's an example of a valid registry item, as `build` writes it to `<url>/login-form.json`:

```json title="login-form.json"
{
  "name": "login-form",
  "type": "registry:ui",
  "title": "Login Form",
  "description": "A login form component.",
  "registryDependencies": ["brand-button"],
  "files": [
    {
      "path": "components/login-form.ts",
      "type": "registry:ui",
      "content": "import { html } from '@webjsdev/core';\n..."
    }
  ]
}
```
