Installation
How to consume chartcn registry items with shadcn add.
Prerequisites
- A project already set up with shadcn/ui (
components.json) chartand usuallycardfrom the official registry
npx shadcn@latest add chart cardHost URL
Public host is TBD. Use an environment placeholder:
| Variable | Example |
|---|---|
CHARTCN_REGISTRY_URL | https://chartcn-web.vercel.app |
| Local demo | http://localhost:3000 |
Install form:
npx shadcn@latest add https://chartcn-web.vercel.app/r/<name>.jsonEndpoints (demo app)
| Path | Payload |
|---|---|
/r/registry.json | Index of all items + install hints |
/r/<name>.json | Built registry item (files include content) |
Source of truth in-repo: apps/web/registry/registry.json and apps/web/registry/items/*.json.
Namespace (optional later)
A namespaced address such as @chartcn/chart-area-stacked can be wired once the host is registered in components.json → registries. Until then, prefer full URLs.