Skip to content
Gelatin UIAlpha

Set up your framework

The exact setup for Vite, Next.js, and TanStack Start. Our install test runs each one in a real app.

Get started · step 3 of 3 · 4 min read

Prompt for your agent

Find the framework of this project: Vite, Next.js, or TanStack Start. Read https://gelatinui.com/docs/frameworks.md and apply the steps for it, with the isolate root for popups. Done when components.json lists the @gelatin-ui registry and the page is wrapped in a div with the isolate class.

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

Each framework below has the steps that our install test runs in a real app. Find your framework, and do its steps in order. Then add the theme and your first component, as Install shows.

Vite

1. Make the app

Use the React and TypeScript template.

2. Add Tailwind CSS 4

Install the packages:

Replace the whole content of src/index.css with this one line. The template rules (a dark-mode block, #root and h1 sizes) would override the theme.

CSS

Delete src/App.css, and remove its import from src/App.tsx.

3. Add the @ alias and the Tailwind plugin

Set the alias in tsconfig.json and in tsconfig.app.json:

JSON

Then write vite.config.ts with the Tailwind plugin and the same alias:

TS

4. Set up Gelatin UI

This command writes components.json with the Gelatin UI registry.

Tested with create-vite 9.3.4.

Next.js

1. Make the app

This App Router template sets up Tailwind CSS 4 and the @ alias for you.

2. Set up Gelatin UI

This command writes components.json with the Gelatin UI registry.

Tested with create-next-app 16.4.5.

TanStack Start

1. Make the app

The React template sets up Tailwind CSS 4 and the @ alias for you.

2. Write components.json by hand

Do not run shadcn init. The template maps #/* in the imports of package.json. So init finds no alias and asks every question. Put this file in the project root:

JSON

Tested with @tanstack/cli 0.72.16.

What differs per framework

The components are the same in every app. Only four places differ:

ViteNext.jsTanStack Start
CSS entrysrc/index.cssapp/globals.csssrc/styles.css
@ points atsrcThe project rootsrc
Set upinit with base.jsoninit with base.jsoncomponents.json by hand
Popup rootsrc/main.tsxapp/layout.tsxsrc/routes/__root.tsx

Add the popup root

Base UI opens a popup (a menu, a dialog, a select) at the end of body. The theme sets body to relative. In the popup root file of the table, wrap the page in a div with the isolate class.

Next.js and TanStack Start wrap the children of body:

TSX

Vite wraps the app in src/main.tsx:

TSX

Now each popup opens above the page.

Fix common errors

What you seeCauseFix
Components show with no styles.The app runs Tailwind CSS 3.Update to Tailwind CSS 4. Replace the three @tailwind lines with @import "tailwindcss";.
Failed to resolve import "@/lib/utils"The @ alias is in TypeScript but not in the bundler, or the reverse.Set the same path in both.
Menus and dialogs open behind the page.The page has no root layer.Wrap the page in a div with the isolate class, as Add the popup root shows.
A Pro item gives 401.The key is missing, wrong, or revoked.Set GELATIN_UI_PRO_TOKEN in the shell that runs the CLI. Then run the add command again.

Next steps