Logobaseui-cn

Getting Started

Theming

baseui-cn uses CSS custom properties for theming. Tokens are defined as raw color values and mapped into Tailwind utilities through @theme, so utility classes like bg-primary/50.

CSS variables

Added to your configured stylesheet, such as app/globals.css or src/styles.css, by npx baseui-cn init.

app/globals.css
`destructive`, `success`, `warning`, and `info` are all first-class semantic tokens. Use them for badges, toasts, alerts, and status-heavy surfaces instead of hard-coding raw color values inside components.

Tailwind v4 theme mapping

Add this @theme block so utilities like bg-primary and text-muted-foreground resolve to your variables.

app/globals.css

Customizing your theme

Override any variable in your :root. Changes propagate to every component automatically.

Dark mode

Uses the .dark class strategy. Add the class to your <html> element. We recommend next-themes for automatic system preference detection.

app/layout.tsx

Base UI data attributes

Base UI applies these attributes to components. Use them in Tailwind for state-based styling.

data-[open]Overlay or disclosure is open
data-[closed]Overlay is closed — use for exit animations
data-[checked]Checkbox, switch, or radio is checked
data-[indeterminate]Checkbox is indeterminate
data-[disabled]Component is disabled
data-[highlighted]List item is focused/highlighted
data-[selected]Select item is selected
data-[starting-style]Entry animation start state
data-[side=top|bottom|left|right]Floating element placement

Accordion & Collapsible animations

Add these keyframes to your main stylesheet for smooth height transitions.

app/globals.css