# Installation

Install editable SUI source with the shadcn CLI.

Page: https://sui.draco.dev/docs/installation

Install SUI source through its shadcn registry. Components, styles, and dependencies integrate with your application configuration.

## Install through the registry

### Prepare the consuming application

Use React 19, Tailwind CSS 4, and a shadcn project configured for Base UI. In an existing application that has not initialized shadcn, run:

```bash
npx shadcn@latest init --base base
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

Use the public GitHub registry directly with `draco-china/sui/<item>` addresses. No `@sui` namespace configuration is required.

### Search, inspect, and install

Run the following commands from the consuming application directory:

```bash
npx shadcn@latest search draco-china/sui -q button
npx shadcn@latest view draco-china/sui/button
npx shadcn@latest add draco-china/sui/button draco-china/sui/code-editor
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

Install the business blocks by their registry names:

```bash
npx shadcn@latest add draco-china/sui/delete-resource draco-china/sui/tanstack-form
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

To install the complete collection, including all components, blocks, layouts, viewers, chat and charts:

```bash
npx shadcn@latest add draco-china/sui/sui
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

Each manifest includes the item's local component dependencies, hooks, helpers, types, package dependencies, and SUI CSS and theme tokens. The CLI installs source into the directories configured by your aliases and merges styles into the configured Tailwind CSS file. Standalone entries `draco-china/sui/sui-style` and `draco-china/sui/sui-theme` provide the shared styles and theme helpers.

Review the generated files and CSS when adding SUI to an application that already has components with the same names or custom theme values. Preview an update before applying it:

```bash
npx shadcn@latest add draco-china/sui/button --dry-run
npx shadcn@latest add draco-china/sui/button --diff
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

Code Editor uses locally bundled Monaco workers and requires a Vite-compatible `?worker` loader. Keep the installed `worker.d.ts` in your TypeScript include paths. This also applies when installing the complete collection.

Blocks default to English. Pass labels from your application's locale configuration to customize their visible text; see the [Delete Resource](/docs/blocks/delete-resource) and [TanStack Form](/docs/blocks/tanstack-form) references.

### Import installed source

With the default shadcn aliases, import from your own application:

```tsx
import { Button } from "@/components/ui/button";

export function SaveButton() {
  return <Button>Save changes</Button>;
}
```

Use the actual aliases in your `components.json` if they differ. Examples throughout this reference use workspace imports such as `@workspace/ui/components/button`. For a registry installation, replace `@workspace/ui/components/*` with your `ui` alias; `@workspace/ui/blocks/*`, `layouts/*`, `viewers/*`, `chat/*` and `charts/*` with your `components` alias followed by the same folder; and hook or helper imports with your `hooks` or `lib` alias. For example, the default aliases use `@/components/ui/data-table`, `@/components/blocks/tanstack-form`, `@/components/charts/bar-chart`, and `@/hooks/use-mobile`. The CLI adapts imports inside the installed files automatically.

## Optional: keep using the namespace

Existing Raw installation URLs and the `@sui` namespace remain available. To use short addresses such as `@sui/button`:

Merge this entry into the application's existing `components.json`. Preserve its CSS path and aliases:

```json
{
  "registries": {
    "@sui": "https://raw.githubusercontent.com/draco-china/sui/main/registry/r/{name}.json"
  }
}
```

The catalog URL is `https://raw.githubusercontent.com/draco-china/sui/main/registry/r/registry.json`. Individual manifests use the same directory.

```bash
npx shadcn@latest add @sui/button
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

## Connect the shadcn MCP server

The [MCP guide](/docs/mcp) covers client configuration, project working directories, example requests, and troubleshooting. MCP shares this application's `@sui` registry configuration. For API documentation and complete example text, use [LLMs](/docs/llms-txt).

See [Theming](/docs/theming) for CSS tokens and [Compatibility](/docs/compatibility) for runtime requirements.

SUI includes only the default light/dark palette with ordinary components. Other palettes are optional: install, for example, `draco-china/sui/theme-lime`, or import `@workspace/ui/themes/lime.css` when using the workspace package. See [Theming](/docs/theming).
