---
title: "Install"
description: "Set up components.json with the Gelatin UI registry, add the theme, then add your first component with the shadcn CLI."
url: https://gelatinui.com/docs/install
markdown_url: https://gelatinui.com/docs/install.md
docs_index: https://gelatinui.com/docs/llms.txt
prompt: "Set up Gelatin UI in this project. Follow https://gelatinui.com/docs/install.md step by step: components.json, the theme, then @gelatin-ui/button. Done when components.json lists the @gelatin-ui registry, the theme variables are in the main stylesheet, and the Button file is in the project."
---

> Docs index: https://gelatinui.com/docs/llms.txt

# Install

> Set up components.json with the Gelatin UI registry, add the theme, then add your first component with the shadcn CLI.

## Before you start

The shadcn CLI needs two things in your project:

| Need                 | Why                                                                  | How to check                                                                               |
| -------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Tailwind CSS 4       | The components use its CSS-first classes, with no `tailwind.config`. | The main stylesheet starts with `@import "tailwindcss";`.                                  |
| The `@` import alias | The added files import each other with `@/`.                         | `tsconfig.json` has `"paths": { "@/*": ["./src/*"] }`, and the bundler has the same alias. |

For Vite, add the `tailwindcss` and `@tailwindcss/vite` packages. For the full setup of each framework, see [Set up your framework](https://gelatinui.com/docs/frameworks.md).

## Set up the registry in components.json

In a new project, run this command:

```bash
npx shadcn@latest init https://gelatinui.com/r/base.json
```

It installs our `base` item, which writes `components.json` with the Gelatin UI registry and the Phosphor icons. The CLI also writes its own default theme and a `src/lib/utils.ts`. The next step replaces both.

If your project has a `components.json` already, add the registry to its `registries` block instead:

```json
{
  "registries": {
    "@gelatin-ui": "https://gelatinui.com/r/{name}.json"
  }
}
```

## Add the theme

Add the theme and our `cn` helper once, before the first component:

```bash
npx shadcn@latest add @gelatin-ui/theme @gelatin-ui/utils --yes --overwrite
```

It writes the light values in `:root` and the dark values in `.dark`, and replaces `src/lib/utils.ts`. Keep both flags: without them, the CLI asks two questions, and with no answer it exits with no change and no error.

Check: `src/index.css` (or your main stylesheet) now has `--primary: oklch(0.17`.

No component or block lists the theme as a dependency. So a later add never changes your colors. If you keep your own shadcn theme, skip this step: our components read the same variable names.

## Add a component

Put the `@gelatin-ui` prefix before the name:

```bash
npx shadcn@latest add @gelatin-ui/button
```

The CLI also adds the components and npm packages that the Button needs.

To add more than one in one command, list them all:

```bash
npx shadcn@latest add @gelatin-ui/button @gelatin-ui/input
```

## Other package managers

Replace `npx` with the runner of your package manager:

| Package manager | Runner       |
| --------------- | ------------ |
| npm             | `npx`        |
| pnpm            | `pnpm dlx`   |
| Yarn            | `yarn dlx`   |
| Bun             | `bunx --bun` |

## What the add writes

The CLI copies the source into your project, at the paths in `components.json`. You own that code, and you can change it. The Install section of each component page lists the files that an add writes.

## Next steps

- [Change the theme](https://gelatinui.com/docs/theming.md): change the colors, the radius, and the fonts.
- [Install Pro items](https://gelatinui.com/docs/pro-items.md): add the Pro registry with your API key.
- [Connect the MCP server](https://gelatinui.com/docs/mcp-server.md): let your agent find components and plan an install.
