## `dinvolt ui add`

Install official shadcn/ui components or packaged Dinvolt blocks. The selected area determines the theme and file paths.

Add public components:

```sh npm
npx dinvolt ui add button dialog --target public
```

```sh bun
bunx dinvolt ui add button dialog --target public
```

```sh pnpm
pnpm dlx dinvolt ui add button dialog --target public
```

```sh yarn
yarn dlx dinvolt ui add button dialog --target public
```

Add an admin block:

```sh npm
npx dinvolt ui add @dinvolt/admin-panel --target admin
```

```sh bun
bunx dinvolt ui add @dinvolt/admin-panel --target admin
```

```sh pnpm
pnpm dlx dinvolt ui add @dinvolt/admin-panel --target admin
```

```sh yarn
yarn dlx dinvolt ui add @dinvolt/admin-panel --target admin
```

Replace an existing official component:

```sh npm
npx dinvolt ui add input --target admin --overwrite
```

```sh bun
bunx dinvolt ui add input --target admin --overwrite
```

```sh pnpm
pnpm dlx dinvolt ui add input --target admin --overwrite
```

```sh yarn
yarn dlx dinvolt ui add input --target admin --overwrite
```

| Option | Purpose |
| --- | --- |
| `--target <area>` | `public` or `admin`. Defaults to public in public-only projects; otherwise admin. |
| `-o, --overwrite` | Replace existing official components in the selected area. |

Provide at least one component. Public-only projects support only the public target. Admin-only projects support only the admin target, with components in `src/components/ui`. Arbitrary registry URLs and third-party namespaces are unsupported.

Customized Dinvolt blocks need manual review, including with `--overwrite`. See the [UI registry](/ui/blocks) for blocks and usage examples.


