Getting started

Install Zentauri UI

Wire the published package into a React or Next.js workspace, enable Tailwind CSS v4 tokens, and start importing UI primitives with stable paths.

Step 1

Install the package

Choose your package manager.

npm install @zentauri-ui/zentauri-components

Step 2

Install peer dependencies

The library expects react, react-dom, class-variance-authority, clsx, and tailwind-merge in your app. Install them alongside the components package.

npm install react react-dom class-variance-authority clsx tailwind-merge

Animated components: install framer-motion

Anything imported from an /animated subpath (for example ui/alert/animated, ui/accordion/animated, or ui/tabs/animated) depends on framer-motion. Install it in apps that use those entry points. If you only use static imports from the main UI path (no /animated), framer-motion is optional.

npm install framer-motion

Optional: react-icons

Install react-icons when you use icon sets from that package.

npm install react-icons

Step 3

Include library paths in globals.css

Add an @source entry so Tailwind scans class names inside @zentauri-ui/zentauri-components. The path is relative to this CSS file—adjust ../ if your file lives elsewhere.

@import "tailwindcss";
@source "../node_modules/@zentauri-ui/zentauri-components";

Step 4

Import and use components

Static building blocks live under the component path (for example ui/alert, ui/accordion). Motion-enabled variants live under a matching /animated entry (for example ui/alert/animated) and require framer-motion as described in Step 2.

Static imports

import { Modal, ModalTrigger, ModalClose, ModalHeader, ModalTitle, ModalDescription, ModalBody } from "@zentauri-ui/zentauri-components/ui/modal";

Animated imports

Use a separate import from the /animated module when you need animated primitives (pattern matches other components such as alert).

import { ModalContentAnimated } from "@zentauri-ui/zentauri-components/ui/modal/animated";

Usage

<div className="rounded-3xl border border-white/10 bg-white/5 p-5 shadow-2xl shadow-slate-950/40 backdrop-blur-xl">
  <Modal>
    <ModalTrigger appearance="default" className="rounded-lg px-3 py-1.5 text-sm">
      Open (sm)
    </ModalTrigger>
    <ModalContentAnimated size="sm" animation="scale">
      <ModalClose />
      <ModalHeader>
        <ModalTitle>Dialog</ModalTitle>
        <ModalDescription>Supporting description.</ModalDescription>
      </ModalHeader>
      <ModalBody>
        <p className="text-sm text-slate-300">Modal body copy.</p>
      </ModalBody>
    </ModalContentAnimated>
  </Modal>
</div>

Preview

Alternative

CLI — copy source into your app

Instead of importing only from node_modules, you can vendor UI (and related hooks) with the same binary as the published package: zentauri-components or zentauri-ui. After the package name, pass that binary name (for example zentauri-components init) so npx runs the CLI instead of a missing shell command. UI tokens for add come from cli/registry.json (components, plus nameAliases such as button buttons). For hook source only, use add hook … with names from the hooks array (generated from tsup.config.ts). Run init once, then add for each UI area; the CLI copies that folder from the package tree src/ui under the path from resolvedPaths.ui (one subfolder per component), rewrites imports to your aliases, pulls hook dependencies, and creates lib/utils if missing.

Initialize components.json

Creates components.json with default path aliases. The CLI walks up from the working directory to find this file for add.

npx @zentauri-ui/zentauri-components init

Add components (registry-driven)

Pass one or more names from the registry (folder names under src/ui, or a configured alias). Test files from the package are not copied.

npx @zentauri-ui/zentauri-components add accordion buttons

Add hooks only (optional)

To vendor hook source without adding a UI folder, use add hook plus hook names from the registry (for example useWindowSize). The CLI also copies transitive sibling-hook dependencies (for example useMediaQuery when you add usePrefersReducedMotion). Hooks that import UI types still expect you to add the matching component or adjust imports.

npx @zentauri-ui/zentauri-components add hook useWindowSize

If npx does not resolve the binary

npx --yes --package=@zentauri-ui/zentauri-components zentauri-components init
npx --yes --package=@zentauri-ui/zentauri-components zentauri-components add button

Default components.json shape

Edit aliases and resolvedPaths so they match your app's tsconfig paths and folder layout.

{
  "aliases": {
    "ui": "@/components/ui",
    "utils": "@/lib/utils",
    "hooks": "@/hooks"
  },
  "resolvedPaths": {
    "ui": "src/components/ui",
    "utils": "src/lib/utils.ts",
    "hooks": "src/hooks"
  }
}

Tailwind after vendoring

When you rely on copied files instead of the package under node_modules, point @source at those paths (adjust relative segments to match where your globals.css lives). You can keep both package and local @source lines during a migration.

@import "tailwindcss";
/* After add, scan copied sources (paths relative to this CSS file) */
@source "../src/components/ui";
@source "../src/hooks";

Overriding theme colors

Override theme colors

You can override the theme colors by using the theme.colors object but be careful as it will override all the colors in your project if you are already using tailwind default colors like slate, red, yellow, amber, green, etc. Consider using a custom color palette for your brand theme.

@theme {
  --color-slate-50: oklch(0.984 0.003 247.858);
  --color-slate-100: oklch(0.968 0.007 247.896);
  --color-slate-200: oklch(0.929 0.013 255.508);
  --color-slate-300: oklch(0.869 0.022 252.894);
  --color-slate-400: oklch(0.704 0.04 256.788);
  --color-slate-500: oklch(0.554 0.046 257.417);
  --color-slate-600: oklch(0.446 0.043 257.281);
  --color-slate-700: oklch(0.372 0.044 257.287);
  --color-slate-800: oklch(0.279 0.041 260.031);
  --color-slate-900: oklch(0.208 0.042 265.755);
  --color-slate-950: oklch(0.129 0.042 264.695);
}

Adding new themes

Adding new themes colors

You can add new themes colors by adding a new theme mapper, passing the required variants like 100, 200, 500, 900 and removing the appearance prop from the component.

export const customAppearancefuchsia = {
  50: "bg-fuchsia-50 text-fuchsia-950",
  100: "bg-fuchsia-100 text-fuchsia-950",
  200: "bg-fuchsia-200 text-fuchsia-950",
  300: "bg-fuchsia-300 text-fuchsia-950",
  400: "bg-fuchsia-400 text-fuchsia-950",
  500: "bg-fuchsia-500 text-fuchsia-950",
  600: "bg-fuchsia-600 text-fuchsia-950",
  700: "bg-fuchsia-700 text-fuchsia-950",
  800: "bg-fuchsia-800 text-fuchsia-950",
  900: "bg-fuchsia-900 text-fuchsia-950",
  950: "bg-fuchsia-950 text-fuchsia-950",
} as const;

export function ButtonOverrideThemeColors({ label }: ButtonProps) {
  return (
    <Button className={cn("w-40", customAppearancefuchsia[500])}>
      {label}
    </Button>
  );
}

What this guide covers

You will link the workspace package or install from npm, configure Tailwind v4 includes, and verify imports in a minimal React tree.

The goal is a repeatable setup developers can paste into internal docs.

Package layout and imports

Exports are organized under predictable entry points so tree-shaking stays effective.

Prefer path imports that match your bundler’s module resolution and avoid deep imports that bypass public API guarantees.

Common use cases

  • Bootstrap a new Next.js design system workspace with shared Tailwind presets.
  • Add Zentauri UI to an existing React SPA bundler (Vite, webpack, or Rspack).
  • Align monorepo packages so apps consume a single version of the UI kit.
  • Document internal onboarding with reproducible install commands.
  • Prepare CI caches for faster installs of workspace-linked packages.

Accessibility and styling notes

Tailwind tokens should inherit from your app’s theme extension so contrast stays on-brand.

Keep global resets minimal to avoid fighting component-level focus styles.

Next.js integration notes

Use environment variables for site metadata and keep server components free of client-only animation drivers unless isolated.

Document any SSR constraints for portals or layered overlays.

FAQ

Which package name should I install?

Use @zentauri-ui/zentauri-components from npm or link the workspace package during local development.

Is Tailwind CSS v4 required?

The library targets Tailwind v4 class patterns; follow the snippets in this guide to align postcss and content globs.

Does this work with React Server Components?

Yes for static markup; interactive demos opt into client components—mirror that split in your app.