nook
Browse the docs

Components

Gantt

Native

Tasks as bars along a shared calendar, with progress and a today line.

See the prompt
  • Design
  • Engineering
  • Marketing

Launch plan
TaskGroupStartEndDone
User researchDesign2026-11-022026-11-08100%
Page designDesign2026-11-092026-11-1870%
Build the pageEngineering2026-11-122026-11-2735%
Checkout and paymentsEngineering2026-11-192026-12-040%
Launch copyMarketing2026-11-162026-11-2520%
Go liveMarketing2026-12-072026-12-08

Installation

npx nook-ui@latest add gantt

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 "Gantt" component to this project, exactly as Nook ships it.

Tasks as bars along a shared calendar, with progress and a today line.

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 gantt`. It writes `components/ui/gantt.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/gantt.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 { Gantt } from "@/components/ui/gantt";

export default function GanttDefault() {
  return (
    <Gantt
      title="Launch plan"
      groups={["Design", "Engineering", "Marketing"]}
      today="2026-11-16"
      tasks={[
        { id: "research", label: "User research", start: "2026-11-02", end: "2026-11-08", progress: 1, group: 0 },
        { id: "design", label: "Page design", start: "2026-11-09", end: "2026-11-18", progress: 0.7, group: 0 },
        { id: "build", label: "Build the page", start: "2026-11-12", end: "2026-11-27", progress: 0.35, group: 1 },
        { id: "payments", label: "Checkout and payments", start: "2026-11-19", end: "2026-12-04", progress: 0, group: 1 },
        { id: "copy", label: "Launch copy", start: "2026-11-16", end: "2026-11-25", progress: 0.2, group: 2 },
        { id: "launch", label: "Go live", start: "2026-12-07", end: "2026-12-08", group: 2 },
      ]}
    />
  );
}
```

API
- `Gantt`: The calendar and its bars. By default the calendar runs whole weeks, Monday to Sunday.
  - `tasks` (`{ id; label; start; end; progress?; group? }[]`): `start` and `end` are ISO days, both included. `progress` runs from 0 to 1. `group` is an index into `groups`.
  - `title` (`string`): What the chart shows, for screen readers.
  - `groups` (`string[]`): Names for the bar colors, such as teams.
  - `today` (`string`): An ISO day to mark with a line.
  - `editable` (`boolean`, default false): Drag a bar to move it, or drag its ends to change the start or the end. Keyboard: arrows move a focused bar by a day, Shift changes the end, Alt changes the start. Changes are announced.
  - `onTaskChange` (`(task: GanttTask) => void`): Called once per finished change with the new start and end. Update `tasks` here: the chart does not keep the change itself.
  - `locale` (`string`, default "en-US"): Locale for dates.
  - `zoom` (`"day" | "week" | "month"`, default "week"): How much time one column covers. Day shows every day (and scrolls sideways when the plan is long), month shows whole calendar months. Bars, the today line and the table stay the same.

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: The chart is described by its title, and the same data is in a table for screen readers. Each bar can be focused to show its dates and progress. With two or more groups a legend names the colors.

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

Usage

import { Gantt } from "@/components/ui/gantt";

export default function GanttDefault() {
  return (
    <Gantt
      title="Launch plan"
      groups={["Design", "Engineering", "Marketing"]}
      today="2026-11-16"
      tasks={[
        { id: "research", label: "User research", start: "2026-11-02", end: "2026-11-08", progress: 1, group: 0 },
        { id: "design", label: "Page design", start: "2026-11-09", end: "2026-11-18", progress: 0.7, group: 0 },
        { id: "build", label: "Build the page", start: "2026-11-12", end: "2026-11-27", progress: 0.35, group: 1 },
        { id: "payments", label: "Checkout and payments", start: "2026-11-19", end: "2026-12-04", progress: 0, group: 1 },
        { id: "copy", label: "Launch copy", start: "2026-11-16", end: "2026-11-25", progress: 0.2, group: 2 },
        { id: "launch", label: "Go live", start: "2026-12-07", end: "2026-12-08", group: 2 },
      ]}
    />
  );
}

Examples

With milestones

Mobile app release
TaskStartEndDone
Write the spec2026-11-022026-11-06100%
Kickoff2026-11-092026-11-09100%
Alpha build2026-11-092026-11-2060%
Beta with 200 testers2026-11-232026-12-040%
Store review2026-12-072026-12-110%
Release2026-12-142026-12-14

Grouped rows

  • Facilities
  • IT
  • People
  • Finance

Office move
TaskGroupStartEndDone
Sign the new leaseFacilities2026-03-022026-03-06100%
Fit out the floorFacilities2026-03-092026-04-0320%
Wire the networkIT2026-03-162026-03-270%
Prepare 40 laptopsIT2026-03-232026-04-100%
Commute surveyPeople2026-03-022026-03-1380%
Move dayPeople2026-04-172026-04-18
Approve the move budgetFinance2026-03-022026-03-1190%

One sprint

This sprint
TaskStartEndDone
Fix checkout rounding2026-11-092026-11-11100%
Order history filters2026-11-102026-11-1650%
Review the accessibility audit2026-11-122026-11-1325%
Prepare the release notes2026-11-162026-11-190%

Zoom by day

Switch between day, week and month columns.

  • Engineering
  • Product

Release week
TaskGroupStartEndDone
Code freezeEngineering2026-11-162026-11-17100%
Regression testsEngineering2026-11-172026-11-2060%
Write release notesProduct2026-11-182026-11-1930%
Store reviewProduct2026-11-202026-11-240%
Staged rolloutEngineering2026-11-252026-11-270%

Zoom by month

  • Platform
  • Growth
  • Mobile

Product roadmap 2027
TaskGroupStartEndDone
Single sign-onPlatform2027-01-052027-02-26100%
Usage billingPlatform2027-02-082027-04-3055%
Referral programGrowth2027-03-012027-05-1420%
iOS appMobile2027-03-152027-07-305%
Docs and SEO overhaulGrowth2027-05-032027-08-200%
Android appMobile2027-07-052027-10-290%

Drag to reschedule

Move a bar, or drag its ends. Arrow keys work too.

  • Design
  • Engineering
  • Marketing
2Nov34567891011121314151617181920212223242526272829301Dec234
User research
Page design
Build the page
Checkout and payments
Launch copy

Launch plan you can reschedule
TaskGroupStartEndDone
User researchDesign2026-11-022026-11-08100%
Page designDesign2026-11-092026-11-1870%
Build the pageEngineering2026-11-122026-11-2735%
Checkout and paymentsEngineering2026-11-192026-12-040%
Launch copyMarketing2026-11-162026-11-2520%

Drag a bar to move it, or drag its left or right end to change the start or the end. With the keyboard, focus a bar and use the arrow keys; Shift changes the end and Alt changes the start.

Props

Gantt

The calendar and its bars. By default the calendar runs whole weeks, Monday to Sunday.

PropTypeDefaultDescription
tasks{ id; label; start; end; progress?; group? }[]–`start` and `end` are ISO days, both included. `progress` runs from 0 to 1. `group` is an index into `groups`.
titlestring–What the chart shows, for screen readers.
groupsstring[]–Names for the bar colors, such as teams.
todaystring–An ISO day to mark with a line.
editablebooleanfalseDrag a bar to move it, or drag its ends to change the start or the end. Keyboard: arrows move a focused bar by a day, Shift changes the end, Alt changes the start. Changes are announced.
onTaskChange(task: GanttTask) => void–Called once per finished change with the new start and end. Update `tasks` here: the chart does not keep the change itself.
localestring"en-US"Locale for dates.
zoom"day" | "week" | "month""week"How much time one column covers. Day shows every day (and scrolls sideways when the plan is long), month shows whole calendar months. Bars, the today line and the table stay the same.

Accessibility

The chart is described by its title, and the same data is in a table for screen readers. Each bar can be focused to show its dates and progress. With two or more groups a legend names the colors.

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