Prerequisites
Before installing components, your project needs:- A
components.jsonfile — created bynpx shadcn@latest init. - The
cn()utility inlib/utils.ts. - Tailwind CSS with the Mzizi design tokens in your global stylesheet. See design tokens.
Installing
A single component
Several at once
Hooks and libraries
Hooks and library utilities install the same way — the item type in the manifest decides where the file lands.Dependency resolution
Installing a component makes the CLI do two things automatically:- Install npm dependencies — packages such as
radix-ui,class-variance-authorityorrecharts. - Install registry dependencies — other registry items the component needs. Installing
dialogpulls inbutton.
What you get
Components install as local files. A typical install creates:cn() class composition, and data-slot
attributes for stable styling hooks.
Customising after install
Because the file is yours, you edit it directly.Adding a variant
Extending props
Updating
To take the latest registry version of a component, run the same add command again:- Commit your current state.
- Run the update.
- Read the diff and re-apply your changes.
Using the API directly
You do not need the CLI. The JSON response carries the complete source infiles[].content:
Practices worth keeping
- Install from the registry rather than copying code out of documentation — the docs paraphrase, the API does not.
- Keep
cn(). Components depend on it from@/lib/utils. - Keep the token layer. Components reference CSS custom properties; without them they render with whatever your project’s fallbacks happen to be.
- Test after updating. Check appearance and behaviour, not just that the build passes.
- Track changes in version control so an update diff is legible.