nook
Browse the docs

Installation

Pick your framework, then your package manager. The steps take about a minute.

1. Create a project

Skip this if you already have a Next.js app with Tailwind CSS v4.

npx create-next-app@latest
Choose TypeScript, Tailwind CSS and the @/* import alias when asked.

2. Run init

This detects your project, writes nook.json and installs the tokens and the cn() helper.

npx nook-ui@latest init

3. Add components

npx nook-ui@latest add button card dialog

Then import them:

import { Button } from "@/components/ui/button";

export default function Page() {
  return <Button>Hello, Nook</Button>;
}

Theme only, no components

init only installs the tokens and the cn() helper. If you do not run add, you get the theme system and its Tailwind utilities (bg-primary, rounded-lg, h-control) and nothing else.

Dark mode

Nook switches to its dark palette when an ancestor has the dark class, usually <html class="dark">. You decide how to toggle it.

What init changes

  • Creates nook.json at the project root.
  • Adds two marked blocks to your global CSS file: nook:tokens and nook:theme. Everything outside the markers is left alone.
  • Adds lib/utils.ts and installs clsx and tailwind-merge with your package manager.

Nook always asks before overwriting a file that already exists. Use --dry-run to preview any command.