Skip to main content
Every registry component follows the same shape. This page is what it takes to add one to mzizi-dev/mzizi-registry.

1. Create the component file

Components live under components/registry/n<number>-<name>/, filed by the node they sit on. See placing a component if you are unsure which that is.

2. Follow the mandatory patterns

Every component carries:
  • CVA variants — class-variance-authority for every visual variant, never inline conditional classes.
  • cn() composition — all className props go through it.
  • A data-slot attribute on the root element.
  • Named exports — the component and its variants. No default export.
  • Radix UI primitives for focus, keyboard and screen-reader behaviour where the component is interactive.
  • TypeScript types extending the appropriate HTML element props.

3. Add it to registry.json

An item with more than one source file where the schema expects exactly one is a manifest bug rather than a bad request, and the API says so — worth knowing when a component 500s and the source looks fine.

4. Rebuild the static registry

This regenerates the static JSON under public/r/.

5. Check it serves

The response should carry the metadata and the inlined source.

6. Add tests

7. Run everything

Checklist

  • CVA + Radix + cn() throughout
  • CSS custom properties only — no hardcoded colours
  • data-slot on the root element
  • Named exports, no default export
  • Entry in registry.json with the right type and dependencies
  • pnpm registry:build runs clean
  • The API serves it
  • Tests, lint and types pass
  • APCA 3.0 contrast, 48px minimum touch targets, keyboard navigation