Installation
Set up Asteria UI in a Next.js, Vite, or Remix project.
Prerequisites
- React 19+
- Tailwind CSS v4 (CSS-first
@theme— notailwind.config.js) - TypeScript (recommended)
Quick start
npx asteria-ui@latest initinit does three things:
- Writes
tokens.css(primitives + semantic layer, light and dark) into your styles. - Adds the Tailwind v4
@thememapping so token utilities work (bg-bg-primary,text-fg-secondary,shadow-glow-focus, …). - Installs shared deps:
clsx,tailwind-merge,class-variance-authority, and drops in thecn()helper.
Then add components as you need them:
npx asteria-ui add buttonEach add copies the component source into your project. You own the file — no
runtime dependency on Asteria.
Next.js (App Router)
- Run
npx asteria-ui@latest initfrom the app root. - Import tokens in your global CSS after Tailwind:
@import "tailwindcss";
@import "./tokens.css";
@import "./theme.css";- Add components:
npx asteria-ui add button- Use them from
@/components/ui/button(or whatever pathinitconfigured).
Vite
Same flow. Point your main CSS at the generated tokens.css / theme.css, ensure
Tailwind v4 is wired through @tailwindcss/vite or PostCSS, then add components
into src/components/ui.
Manual copy-paste
If you skip the CLI:
- Copy
tokens.cssand the@themeblock from the docs repo into your styles. - Add
cn():
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}- Copy each component's source from its docs page (or the registry JSON) into your codebase.
shadcn registry compatibility
Asteria's registry follows the open shadcn schema, so components are also installable with:
npx shadcn add https://asteria-ui.com/r/button.json