Get started
Installation
Works in any React project with Tailwind CSS v4. Pick a primitive, pick your framework, add a component.
Not on React? Use the HTML + CSS layer instead, from Go, Django, Rails, Laravel or htmx.
Base UI or Radix
15 components (dialog, select, menu, tooltip, tabs, slider…) come in two builds. Same props, same look, same motion. Only the library underneath changes: radix-ui or @base-ui/react.
Use the one your project already has, so you don’t ship both. If you picked Base UI during shadcn init, pick it here too. Starting fresh? Use Base UI. It is the default here, and what shadcn recommends now.
This switch changes every command and code sample on the site. It remembers your choice.
Pick your framework
Already using shadcn? Still run init. It only adds our registry, nothing else.
- 1
Create a project
The default starter already has TypeScript, Tailwind CSS v4 and the
@/*alias. Skip this in an existing app.pnpm dlx create-next-app@latest my-app --yes - 2
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 3
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 4
Use it
Interactive components start with
"use client", so you can render them straight from a Server Component.import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; export default function Page() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
- 1
Create a project
pnpm create vite@latest my-app --template react-ts - 2
Add Tailwind CSS
pnpm add tailwindcss @tailwindcss/vite pnpm add -D @types/node - 3
Import Tailwind
Replace the contents of
src/index.css.@import "tailwindcss"; - 4
Add the @ alias to TypeScript
Add
pathsto bothtsconfig.jsonandtsconfig.app.json.{ "compilerOptions": { // TypeScript 6+ dropped baseUrl: paths resolve from this file. "paths": { "@/*": ["./src/*"] } } } - 5
Configure Vite
import path from "node:path"; import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { "@": path.resolve(__dirname, "./src") } }, }); - 6
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 7
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 8
Use it
import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; export default function App() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
- 1
Create a project
Framework mode ships with Tailwind CSS v4 and the
~/*alias. The CLI rewrites our imports to match.pnpm dlx create-react-router@latest my-app - 2
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 3
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 4
Use it
import { Button } from "~/components/astabyte/button"; import PriceChart from "~/components/astabyte/price-chart"; export default function Home() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
- 1
Create a project
pnpm create astro@latest my-app - 2
Add React and Tailwind CSS
pnpm dlx astro add react tailwind - 3
Add the @ alias
{ "extends": "astro/tsconfigs/strict", "compilerOptions": { // TypeScript 6+ dropped baseUrl: paths resolve from this file. "paths": { "@/*": ["./src/*"] } } } - 4
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 5
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 6
Use it
Components are interactive, so hydrate them with a
client:directive.client:visibleloads each one as it scrolls in.--- import "@/styles/global.css"; import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; --- <main class="dark bg-paper p-8 text-ink"> <Button client:load variant="accent">Deploy</Button> <div class="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart client:visible /> </div> </main>
- 1
Create a project
Choose Tailwind CSS when the starter asks. It sets up the
@/*alias for you.pnpm create @tanstack/start@latest my-app - 2
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 3
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 4
Use it
import { createFileRoute } from "@tanstack/react-router"; import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; export const Route = createFileRoute("/")({ component: Home }); function Home() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
- 1
Create a project
pnpm dlx gatsby new my-app - 2
Add Tailwind CSS
pnpm add tailwindcss @tailwindcss/postcss postcss gatsby-plugin-postcss - 3
Configure PostCSS
Add
"gatsby-plugin-postcss"topluginsingatsby-config, then create the PostCSS config.module.exports = { plugins: { "@tailwindcss/postcss": {} }, }; - 4
Import Tailwind
Create
src/styles/globals.cssand import it fromgatsby-browser.tsx.@import "tailwindcss"; - 5
Add the @ alias
Add the same
pathstotsconfig.json, then point webpack at it.import path from "node:path"; import type { GatsbyNode } from "gatsby"; export const onCreateWebpackConfig: GatsbyNode["onCreateWebpackConfig"] = ({ actions }) => { actions.setWebpackConfig({ resolve: { alias: { "@": path.resolve(__dirname, "src") } }, }); }; - 6
Set up Astabyte UI
Runs
shadcn initwhen there is nocomponents.jsonyet (pick any base colour: our components bring their own tokens), then adds the@astabyteregistry. It points at the Base UI builds unless you add--radix; if shadcn asks for a component library, pick the same one.pnpm dlx asta-ui@latest init --radixpnpm dlx asta-ui@latest init - 7
Add components
Files land in
components/astabyte/, npm dependencies are installed and the tokens are merged into your CSS. Plain shadcn works too:pnpm dlx shadcn@latest add @astabyte/button.pnpm dlx asta-ui@latest add button price-chart --radixpnpm dlx asta-ui@latest add button price-chart - 8
Use it
import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; export default function Index() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
- 1
Have React and Tailwind CSS v4
Any bundler works. Components are plain React with Tailwind classes: no framework imports, no runtime styling library.
- 2
Add the tokens
Paste this into your main stylesheet. Components read
paper,ink,mute,signalandbrand.@import "tailwindcss"; @custom-variant dark (&:is(.dark *)); @theme inline { --color-paper: var(--paper); --color-paper-2: var(--paper-2); --color-ink: var(--ink); --color-ink-2: var(--ink-2); --color-mute: var(--mute); --color-signal: var(--signal); --color-brand: var(--brand); --color-on-signal: var(--on-signal); --color-on-brand: var(--on-brand); --color-line: var(--line); --color-line-inv: var(--line-inv); --ease-expo: cubic-bezier(0.16, 1, 0.3, 1); --ease-quart: cubic-bezier(0.76, 0, 0.24, 1); } :root { --paper: #fcfcfb; --paper-2: #f2f2f0; --ink: #0a0a0a; --ink-2: #3b3b3a; --mute: #6b6b68; --signal: #0a0a0a; --brand: #2f54eb; --on-signal: #ffffff; --on-brand: #ffffff; --line: rgb(10 10 10 / 0.1); --line-inv: rgb(10 11 10 / 0.14); } .dark { --paper: #0b0b0c; --paper-2: #151516; --ink: #f2f2f0; --ink-2: #cfcfcc; --mute: #828285; --signal: #f2f2f0; --brand: #8aa4ff; --on-signal: #0b0b0c; --on-brand: #0b0b0c; --line: rgb(242 242 240 / 0.12); --line-inv: rgb(10 11 10 / 0.14); } - 3
Copy the component
Open a component page, pick Radix or Base UI, copy every file from the Code tab and install the packages it lists. The raw files are also in
https://ui.astabyte.com/r/<name>.json(Radix) andhttps://ui.astabyte.com/r/base/<name>.json(Base UI). - 4
Use it
import { Button } from "@/components/astabyte/button"; import PriceChart from "@/components/astabyte/price-chart"; export default function Page() { return ( <main className="dark bg-paper p-8 text-ink"> <Button variant="accent">Deploy</Button> <div className="mt-6 aspect-[4/3] max-w-md [container-type:size]"> <PriceChart /> </div> </main> ); }
Add a component
Name the components you want. The CLI checks the names, uses the build you picked in init, and lets the shadcn CLI do the rest. Every component page has its own command.
$ pnpm dlx asta-ui@latest add dialog --radixTwo more: list shows every component, prompt <name> prints a prompt for your AI agent.
Install as a package
Prefer imports over owning files? asta-ui is also a regular library: every component, compiled, with types. Update with pnpm update asta-ui. Customise with props and tokens. Needs React 18.3+ and Tailwind CSS v4.
pnpm add asta-ui radix-uipnpm add asta-ui @base-ui/reactImport the stylesheet once, right after Tailwind. It brings the tokens and tells Tailwind where our classes live.
@import "tailwindcss";
@import "asta-ui/styles.css";Classes missing? Your node_modules is probably somewhere unusual. Add @source "../node_modules/asta-ui/dist"; to your CSS, with the path relative to that file.
asta-ui is the Radix build. asta-ui/base is the Base UI build. Each needs its own library installed.
Only need one component? Import it by path, like asta-ui/price-chart or asta-ui/base/dialog. Everything is marked "use client", so Server Components can render it.
import { Button, Dialog, PriceChart, TextareaAui003 } from "asta-ui";
// Base UI build: import { Button, Dialog, PriceChart } from "asta-ui/base";
// One component, no primitive package needed: import { PriceChart } from "asta-ui/price-chart";
export default function Page() {
return (
<main className="dark bg-paper p-8 text-ink">
<Button variant="accent">Deploy</Button>
<div className="mt-6 h-80 max-w-md">
<PriceChart />
</div>
<TextareaAui003 />
</main>
);
}Names match the component pages: Dialog, PriceChart, OrderBook. Variants have two names, the id TextareaAui003 and a friendly one, ChatComposer. Motion blocks fill their parent, so give the wrapper a size.
Registry URLs
Don’t want our CLI? Every component is a plain shadcn registry item:
- Radix:
https://ui.astabyte.com/r/<name>.json - Base UI:
https://ui.astabyte.com/r/base/<name>.json - Index:
https://ui.astabyte.com/r/registry.json
To use short names like @astabyte/button, add this to components.json. It’s exactly what asta-ui init writes.
{
"registries": {
"@astabyte": "https://ui.astabyte.com/r/{name}.json"
}
}{
"registries": {
"@astabyte": "https://ui.astabyte.com/r/base/{name}.json"
}
}Want both builds at hand? Add a second namespace, like "@astabyte-base": "https://ui.astabyte.com/r/base/{name}.json".
Tokens and dark mode
Components read five colours. Change them and everything follows.
paper: backgroundink: textmute: secondary textsignal: strong contrastbrand: the one accent colour. Not calledaccent, so it doesn’t clash with shadcn.
:root is light, .dark is dark. Motion blocks are designed on dark, so wrap them in an element with the dark class.
Use it with an AI agent
Claude Code, Cursor and Codex can pick and install components for you. Set it up on AI agents, or grab a prompt from Prompts. Every component page also has a Copy prompt button.