Use the Registry
The package exports a typed registry module and a JSON file. Use the module when you need a name lookup or type information. Import the JSON file when you only need metadata.
import {
componentRegistry,
getRegistryComponent,
registryComponentNames,
} from "@dicehub/kappa/registry";
const button = getRegistryComponent("Button");
console.log(button?.importPath);
console.log(registryComponentNames.length);
console.log(componentRegistry.search.byType.block);import registry from "@dicehub/kappa/registry/component-registry.json" with { type: "json" };
console.log(registry.schemaVersion);getRegistryComponent(name) returns undefined when the name is not in the registry. Import a component from the returned importPath in your application source; the registry does not load it for you.
Data Shape
The current schema version is 1. The top level has package, components, and search fields.
| Field | Content |
|---|---|
components[name] | Name, type, group, import path, source file, description, and optional part names. |
search.byName | Component and block names. |
search.byType | Names grouped as component or block. |
search.byGroup | Names grouped by their module. |
This metadata lists public exports. It is not a runtime component loader or a source-code installer.
Source and Updates
The registry generator reads component and block barrels under packages/kappa/src. It writes src/registry/generated.ts and src/registry/component-registry.json. Do not edit those outputs by hand.
pnpm --filter @dicehub/kappa codegen:registry
pnpm --filter @dicehub/kappa check:registryIf a new export is missing, check its barrel and public package export first. See Contributing for the other checks needed before handoff.