nook
Browse the docs

Components

Todo list

Built on Base UI

Tasks you can add, edit, filter and reorder, plus a progress checklist for setup guides.

See the prompt

Before we ship

The small things that make a release feel finished.

3 left

Press Space to pick up, arrows to move, Space to drop, or Escape to cancel. You can also drag the handle.

  • medium priority
  • high priority

Installation

npx nook-ui@latest add todo-list

Prompt

Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.

Short. For assistants that can run commands in your project.

Plain text
Add the Nook "Todo list" component to this project, exactly as Nook ships it.

Tasks you can add, edit, filter and reorder, plus a progress checklist for setup guides.

Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add todo-list`. It writes `components/ui/todo-list.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/todo-list.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:

```tsx
import { TodoList } from "@/components/ui/todo-list";

export default function TodoListDefault() {
  return <div className="grid w-full gap-4"><div><h3 className="font-semibold">Before we ship</h3><p className="mt-1 text-xs text-muted-foreground">The small things that make a release feel finished.</p></div><TodoList aria-label="Release tasks" defaultValue={[
    { id: "copy", title: "Read the welcome email aloud", priority: "medium", dueDate: "2026-11-18" },
    { id: "keyboard", title: "Try the checkout with a keyboard", priority: "high" },
    { id: "empty", title: "Write helpful empty states", done: true },
    { id: "support", title: "Brief the support team", dueDate: "2026-11-20" },
  ]} /></div>;
}
```

API
- `TodoList`: Task state can live here or in your app. Filtering preserves hidden tasks when visible tasks are reordered. Deleting or clearing completed tasks offers Undo.
  - `value, defaultValue, onValueChange` (`TodoTask[], TodoTask[], (tasks: TodoTask[]) => void`): Tasks with id, title, optional done, dueDate (YYYY-MM-DD), and priority (low, medium, high).
  - `defaultFilter` (`"all" | "active" | "done"`, default all): Which tasks to show first.
  - `placeholder` (`string`, default Add a task…): Prompt in the add field.
- `Checklist`: A collapsible list of setup steps with a Progress bar and a written count.
  - `steps` (`ChecklistStep[]`): Each step has id, title, optional description, href, actionLabel, and initial done state.
  - `title` (`string`, default Get started): Heading and collapse button label.
  - `value, defaultValue, onValueChange` (`string[], string[], (done: string[]) => void`): IDs of completed steps. Without an initial value, reads each step’s done flag.
  - `open, defaultOpen, onOpenChange` (`boolean, boolean, (open: boolean) => void`, default true): Controlled or initial expansion state.

Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: Named checkboxes, Enter to add, Enter or F2 to edit, Escape to cancel edits, SortableList keyboard handles, spoken changes and a persistent Undo action. Filter labels include their counts. Checklist exposes expanded state and named progress.

Done when the component renders like the example in light and dark mode and the project type-checks.

Usage

import { TodoList } from "@/components/ui/todo-list";

export default function TodoListDefault() {
  return <div className="grid w-full gap-4"><div><h3 className="font-semibold">Before we ship</h3><p className="mt-1 text-xs text-muted-foreground">The small things that make a release feel finished.</p></div><TodoList aria-label="Release tasks" defaultValue={[
    { id: "copy", title: "Read the welcome email aloud", priority: "medium", dueDate: "2026-11-18" },
    { id: "keyboard", title: "Try the checkout with a keyboard", priority: "high" },
    { id: "empty", title: "Write helpful empty states", done: true },
    { id: "support", title: "Brief the support team", dueDate: "2026-11-20" },
  ]} /></div>;
}

Examples

Workspace setup

2 of 4 done

x

Empty list

Today

0 left

Press Space to pick up, arrows to move, Space to drop, or Escape to cancel. You can also drag the handle.

  • A clear list. Add your first task above.

Finished tasks

Moving checklist

1 left

Press Space to pick up, arrows to move, Space to drop, or Escape to cancel. You can also drag the handle.

Priorities and due dates

Week of the launch

4 left

Press Space to pick up, arrows to move, Space to drop, or Escape to cancel. You can also drag the handle.

  • high priority
  • high priority
  • low priority
  • medium priority

Props

TodoList

Task state can live here or in your app. Filtering preserves hidden tasks when visible tasks are reordered. Deleting or clearing completed tasks offers Undo.

PropTypeDefaultDescription
value, defaultValue, onValueChangeTodoTask[], TodoTask[], (tasks: TodoTask[]) => void–Tasks with id, title, optional done, dueDate (YYYY-MM-DD), and priority (low, medium, high).
defaultFilter"all" | "active" | "done"allWhich tasks to show first.
placeholderstringAdd a task…Prompt in the add field.

Checklist

A collapsible list of setup steps with a Progress bar and a written count.

PropTypeDefaultDescription
stepsChecklistStep[]–Each step has id, title, optional description, href, actionLabel, and initial done state.
titlestringGet startedHeading and collapse button label.
value, defaultValue, onValueChangestring[], string[], (done: string[]) => void–IDs of completed steps. Without an initial value, reads each step’s done flag.
open, defaultOpen, onOpenChangeboolean, boolean, (open: boolean) => voidtrueControlled or initial expansion state.

Accessibility

Named checkboxes, Enter to add, Enter or F2 to edit, Escape to cancel edits, SortableList keyboard handles, spoken changes and a persistent Undo action. Filter labels include their counts. Checklist exposes expanded state and named progress.

Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.