Installation
datui ships compiled ESM and CommonJS builds, TypeScript declarations and a stylesheet that plugs into your Tailwind CSS v4 build.
Requirements
- React 18.2 or newer (React 19 recommended)
- Tailwind CSS 4.x
- Any React framework; tested with Next.js 16 (App Router)
1. Install
pnpm add datuireact and react-dom are peer dependencies; everything else installs with datui.
2. Import the styles
In the CSS file where you import Tailwind, add datui after it. This registers the design tokens, the dark theme and tells Tailwind to generate the utilities datui components use.
@import "tailwindcss";
@import "datui/styles.css";3. Wrap your app
ConfigProvider holds app-wide settings (color scheme, locale, direction). AppRoot applies them to the DOM and hosts the layer overlays render into, so dialogs and popovers pick up the right theme.
"use client";
import { AppRoot, ConfigProvider } from "datui";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<ConfigProvider colorScheme="system">
<AppRoot>{children}</AppRoot>
</ConfigProvider>
);
}4. Use components
import { Button } from "datui";
export function Save() {
return <Button variant="primary">Save</Button>;
}Server components
The package entry is marked "use client", so datui components can be rendered from server components; they hydrate on the client. Components never touch window during render.