Skip to content

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.

Primitive

Pick your framework

Already using shadcn? Still run init. It only adds our registry, nothing else.

  1. 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. 2

    Set up Astabyte UI

    Runs shadcn init when there is no components.json yet (pick any base colour: our components bring their own tokens), then adds the @astabyte registry. 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 --radix
    pnpm dlx asta-ui@latest init
  3. 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 --radix
    pnpm dlx asta-ui@latest add button price-chart
  4. 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>
      );
    }

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 --radix

Or with the shadcn CLI: pnpm dlx shadcn@latest add https://ui.astabyte.com/r/base/dialog.json

Two 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-ui
pnpm add asta-ui @base-ui/react

Import 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: background
  • ink: text
  • mute: secondary text
  • signal: strong contrast
  • brand: the one accent colour. Not called accent, 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.

Next Button