Getting Started
Installation
Set up baseui-cn in your Next.js or React project in two commands. Works with pnpm, npm, yarn, and bun.
Requirements
Node.js18.0 or laterReact18.0 or laterNext.js15+ with App Router (recommended) or any React 18+ projectTailwind CSSv4 (CSS-first config)@base-ui/reactInstalled automatically by initStep 1 — Initialize
Run this in your project root. It auto-detects your structure and sets everything up.
npx baseui-cn initPrefer a specific stylesheet? Pass --css src/styles.css and baseui-cn will use that path instead of guessing.
Detects projectFinds Next.js, src/ dir, App Router vs Pages Router automaticallyInstalls deps@base-ui/react · clsx · tailwind-merge · class-variance-authorityCSS variablesPrompts for your stylesheet and injects theme tokens, including destructive, success, warning, and infoUtilsCreates lib/utils.ts with the cn() helperConfigWrites baseui-cn.json with your resolved pathsStep 2 — Add components
Each component is copied directly into your project. You own the code.
npx baseui-cn add buttonAdd several at once:
npx baseui-cn add dialog drawer select comboboxOr add everything:
npx baseui-cn add --allStep 3 — Import and use
Components land in components/ui/. Import and use immediately.
baseui-cn.json
Created at your project root by init. Edit to change where components, utils, and theme styles are placed.
Manual installation
Prefer to set things up yourself? Install the dependencies and copy components manually.
Then add the CSS variables from the Theming page to your main stylesheet and create lib/utils.ts:
Already have a design system?
baseui-cn uses the same CSS variable naming convention as other registry-style systems. If you already have --background, --primary, etc. in your stylesheet, components will pick them up automatically.