A root registry is the registry the CLI reads names from. Sveltery UI's is at https://ui.sveltery.dev/r. Point the CLI at another one with the registry key in components.json or with SVELTERY_REGISTRY_URL, for example to test a preview deploy or to serve a mirror.
A root registry serves a manifest at index.json, which follows the registry.json schema:
{
"$schema": "https://ui.sveltery.dev/schema/registry.json",
"name": "sveltery",
"registryVersion": 1,
"styles": ["vega", "nova", "maia", "lyra", "mira", "luma", "sera", "rhea"],
"baseColors": ["neutral", "stone", "zinc", "mauve", "olive", "mist", "taupe"],
"iconLibraries": ["lucide", "tabler", "hugeicons", "phosphor", "remixicon"],
"items": [
{ "name": "accordion", "type": "registry:ui" },
{ "name": "button", "type": "registry:ui" }
]
} To share your own components, you do not need a root registry. Serve item files and install them by URL, as Getting Started shows.
Layout
The CLI reads these paths below the registry root:
init --preset with a preset name or code fetches /init on the registry's origin, which returns a registry:base item. init also writes <origin>/schema.json to the $schema key of components.json.
Definitions
The JSON Schema for registry.json is at ui.sveltery.dev/schema/registry.json.
$schema
Required. The URL of the schema.
{
"$schema": "https://ui.sveltery.dev/schema/registry.json"
} name
Required. Must be sveltery.
{
"name": "sveltery"
} registryVersion
Required. The version of the registry format, which is 1. The CLI reads it first. When it is higher than the version the CLI reads, the CLI stops and asks you to update it.
{
"registryVersion": 1
} styles
Required. The styles the registry serves. init stops when the project's style is not in this list.
{
"styles": ["nova", "vega"]
} baseColors
Required. The base colors that have a theme item under themes/.
{
"baseColors": ["neutral", "stone"]
} iconLibraries
Required. The icon libraries the items support.
{
"iconLibraries": ["lucide", "tabler"]
} items
Required. Every item the registry serves under each style, with its name and type, and an optional description. add accepts only names in this list, add --all adds all of them, and list prints them.
{
"items": [
{ "name": "button", "type": "registry:ui", "description": "Displays a button." }
]
}