# Registry

Learn how to use the chartcn registry with the shadcn CLI.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



The **chartcn** registry ships ChartGPU-powered components and blocks in the [shadcn registry format](https://ui.shadcn.com/docs/registry). Register the namespace once in `components.json`, then pull items by name with the CLI.

## Setup [#setup]

Add a **registries** entry for this site. See the [shadcn registry documentation](https://ui.shadcn.com/docs/registry) for all `components.json` fields and behaviors.

```json
{
  "registries": {
    "@chartcn": "https://chartcn.com/r/{name}.json"
  }
}
```

You can replace `@chartcn` with another namespace; it only needs to match what you pass to `shadcn add`.

## Usage [#usage]

Items are organized as reusable chart families and complete chart blocks.

Install a chart component:

```bash
npx shadcn@latest add @chartcn/line-chart
```

Install a complete block:

```bash
npx shadcn@latest add @chartcn/monospace-bar-chart
```

Without a registry alias, use the full URL shown on each docs page:

```bash
npx shadcn@latest add https://chartcn.com/r/line-chart.json
```

```bash
npx shadcn@latest add https://chartcn.com/r/monospace-bar-chart.json
```

The CLI installs the selected source files together with their ChartGPU and shared registry dependencies.
