compacto-ui

Search documentation

Jump to a page or a component.

Installation

No npm install. An AI agent copies component source out of this repo's registry, you add its npm dependencies, and wire up one Tailwind import.

Copy a component

There is no package to install. Point your AI agent (or the shadcn CLI) at this repo and name the component — it reads registry.json, resolves dependencies, and writes source into your app at components/ui/*.tsx and lib/*.ts. Full protocol: AI-REFERENCE.md at the repo root.

import { Button } from "@/components/ui/button";

Install its dependencies

Every registry item lists the npm packages it needs. The core four cover most components:

pnpm add class-variance-authority clsx radix-ui tailwind-merge

Plus whichever of these a copied component's item actually lists: cmdk, date-fns, lucide-react, react-day-picker, react-resizable-panels. Requires React 19.2+ and Tailwind v4.

Stylesheet

Copy the styles registry item (tokens.css, theme.css, texture.css, index.css) to styles/compacto/ once, then:

@import "tailwindcss";
@import "./compacto/index.css";

@custom-variant dark (&:is(.dark *));

/* Supply your own faces to the design system's font namespaces. */
:root {
  --app-font-sans: var(--font-open-sans);
  --app-font-title: var(--font-poppins);
  --app-font-display: var(--font-poppins);
  --app-font-description: var(--font-open-sans);
  --app-font-mono: var(--font-jetbrains-mono);
}

Theme it

Copy the palette-providerregistry item and mount it once in the root layout. It writes the active palette's --app-* variables onto documentElement; drive it with OptionPalette or usePalette(). Persistence is yours — pass the saved key as defaultPalette.

<PaletteProvider defaultPalette="midnight-dark">{children}</PaletteProvider>

Reproducing the look without the components — another framework, plain CSS — is what DESIGN.md at the repo root is for.

Migrating from shadcn tokens

If your own feature code still writes bg-primary or text-muted-foreground, copy the opt-in compat-shadcn registry item too. It aliases the semantic variables onto --app-*.

@import "./compacto/compat-shadcn.css";

Drop the import once a grep for semantic utilities in your src/ comes back empty. Scheduled for removal in v2.

If classes don't generate

  • The symptom is silent: components render unstyled because Tailwind never scanned the copied files.
  • theme.css assumes Tailwind's default content auto-detection sees the copied components — true once they live under your app's own src/. If your build customizes content scanning, add an explicit @source pointing at wherever you copied components/ui and styles/compacto to.