Getting started
Five steps from an empty app to a fully themed shadcn/ui surface. No build plugins, no source access — the theme is a published CSS package.
1 · Install
The theme package, the tiny React store, and the two font families the design specifies (a CSS-only package cannot ship font files).
pnpm add @brookui/theme-soft-day @brookui/react
pnpm add @fontsource/jost @fontsource/nunito-sans2 · One CSS import
The package's root export is the single-file bundle: token layers, the shadcn bridge and all component styles, in cascade order.
/* global css (Tailwind v4 shown; plain CSS works too) */
@import "tailwindcss";
@import "@fontsource/jost/400.css";
@import "@fontsource/jost/500.css";
@import "@fontsource/nunito-sans/400.css";
@import "@fontsource/nunito-sans/700.css";
/* tokens + shadcn bridge + every component style, one file */
@import "@brookui/theme-soft-day";3 · Wrap your app
The store keeps data-theme and the dark class on <html> and persists both in cookies, so server-rendered pages do not flash the wrong theme.
// app/layout.tsx (Next.js App Router shown)
import { cookies } from "next/headers";
import { ThemeStoreProvider } from "@brookui/react";
export default async function RootLayout({ children }) {
const store = await cookies();
const theme = store.get("ui-theme")?.value || "soft-day";
const dark = store.get("ui-dark")?.value === "1";
return (
<html lang="en" data-theme={theme} suppressHydrationWarning>
<body>
<ThemeStoreProvider
themes={[{ id: "soft-day", name: "Soft Day" }]}
initialTheme={theme}
initialDark={dark}
>
{children}
</ThemeStoreProvider>
</body>
</html>
);
}4 · Dark mode
// anywhere client-side
"use client";
import { useThemeStore } from "@brookui/react";
export function DarkToggle() {
const { dark, setDark } = useThemeStore();
return <button onClick={() => setDark(!dark)}>{dark ? "Light" : "Dark"}</button>;
}
// the store sets data-theme and the .dark class on <html> and persists both cookies5 · Tailwind bridge (Tailwind apps)
The bundle already defines the shadcn semantic variables; Tailwind apps map them into utility tokens once, in an @theme inline block.
/* Tailwind v4 app-side bridge (map shadcn semantics to utilities) */
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-border: var(--border);
--color-ring: var(--ring);
/* ...the rest of the shadcn set you use */
--radius-lg: var(--radius);
--font-sans: var(--prism-font-family-sans);
--font-heading: var(--prism-font-family-display);
}