Getting started
Installation
Add ui-kit to a Next.js or React app.
Install
The package is not on npm yet (Phase 6). Inside this monorepo, apps depend on it as a workspace package.
npm install ui-kit # after it is publishedAdd the styles
If your app runs Tailwind v4, import the kit after Tailwind so its tokens and classes join your build:
app/globals.css
@import "tailwindcss";
@import "ui-kit/kit.css";No Tailwind? Import the prebuilt stylesheet instead: import 'ui-kit/styles.css'.
Add the theme script
app/layout.tsx
import { ThemeScript } from 'ui-kit';
import './globals.css';
export default function RootLayout({ children }) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<ThemeScript />
</head>
<body>{children}</body>
</html>
);
}It applies the saved light/dark mode and accent before the first paint. Change them anywhere with useTheme().
Use a component
import { Button, Icon } from 'ui-kit';
export function SaveBar() {
return (
<Button>
<Icon name="check" />
Save changes
</Button>
);
}Interactive components carry 'use client' themselves, so you can render them from Server Components; pass event handlers from a client component.