Skip to content
Gelatin UIAlpha

Install

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

Get started · step 2 of 3 · 3 min read

Prompt for your agent

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.

Your agent reads /docs/install.md: the same text as this page, as Markdown.

Before you start

The shadcn CLI needs two things in your project:

NeedWhyHow to check
Tailwind CSS 4The components use its CSS-first classes, with no tailwind.config.The main stylesheet starts with @import "tailwindcss";.
The @ import aliasThe 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.

Set up the registry in components.json

In a new project, run this command:

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

Add the theme

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

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:

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

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

Other package managers

Replace npx with the runner of your package manager:

Package managerRunner
npmnpx
pnpmpnpm dlx
Yarnyarn dlx
Bunbunx --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