Components
Gantt
NativeTasks as bars along a shared calendar, with progress and a today line.
- Design
- Engineering
- Marketing
| Task | Group | Start | End | Done |
|---|---|---|---|---|
| User research | Design | 2026-11-02 | 2026-11-08 | 100% |
| Page design | Design | 2026-11-09 | 2026-11-18 | 70% |
| Build the page | Engineering | 2026-11-12 | 2026-11-27 | 35% |
| Checkout and payments | Engineering | 2026-11-19 | 2026-12-04 | 0% |
| Launch copy | Marketing | 2026-11-16 | 2026-11-25 | 20% |
| Go live | Marketing | 2026-12-07 | 2026-12-08 |
Installation
npx nook-ui@latest add ganttPrompt
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.
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
| Task | Start | End | Done |
|---|---|---|---|
| Write the spec | 2026-11-02 | 2026-11-06 | 100% |
| Kickoff | 2026-11-09 | 2026-11-09 | 100% |
| Alpha build | 2026-11-09 | 2026-11-20 | 60% |
| Beta with 200 testers | 2026-11-23 | 2026-12-04 | 0% |
| Store review | 2026-12-07 | 2026-12-11 | 0% |
| Release | 2026-12-14 | 2026-12-14 |
Grouped rows
- Facilities
- IT
- People
- Finance
| Task | Group | Start | End | Done |
|---|---|---|---|---|
| Sign the new lease | Facilities | 2026-03-02 | 2026-03-06 | 100% |
| Fit out the floor | Facilities | 2026-03-09 | 2026-04-03 | 20% |
| Wire the network | IT | 2026-03-16 | 2026-03-27 | 0% |
| Prepare 40 laptops | IT | 2026-03-23 | 2026-04-10 | 0% |
| Commute survey | People | 2026-03-02 | 2026-03-13 | 80% |
| Move day | People | 2026-04-17 | 2026-04-18 | |
| Approve the move budget | Finance | 2026-03-02 | 2026-03-11 | 90% |
One sprint
| Task | Start | End | Done |
|---|---|---|---|
| Fix checkout rounding | 2026-11-09 | 2026-11-11 | 100% |
| Order history filters | 2026-11-10 | 2026-11-16 | 50% |
| Review the accessibility audit | 2026-11-12 | 2026-11-13 | 25% |
| Prepare the release notes | 2026-11-16 | 2026-11-19 | 0% |
Zoom by day
Switch between day, week and month columns.
- Engineering
- Product
| Task | Group | Start | End | Done |
|---|---|---|---|---|
| Code freeze | Engineering | 2026-11-16 | 2026-11-17 | 100% |
| Regression tests | Engineering | 2026-11-17 | 2026-11-20 | 60% |
| Write release notes | Product | 2026-11-18 | 2026-11-19 | 30% |
| Store review | Product | 2026-11-20 | 2026-11-24 | 0% |
| Staged rollout | Engineering | 2026-11-25 | 2026-11-27 | 0% |
Zoom by month
- Platform
- Growth
- Mobile
| Task | Group | Start | End | Done |
|---|---|---|---|---|
| Single sign-on | Platform | 2027-01-05 | 2027-02-26 | 100% |
| Usage billing | Platform | 2027-02-08 | 2027-04-30 | 55% |
| Referral program | Growth | 2027-03-01 | 2027-05-14 | 20% |
| iOS app | Mobile | 2027-03-15 | 2027-07-30 | 5% |
| Docs and SEO overhaul | Growth | 2027-05-03 | 2027-08-20 | 0% |
| Android app | Mobile | 2027-07-05 | 2027-10-29 | 0% |
Drag to reschedule
Move a bar, or drag its ends. Arrow keys work too.
- Design
- Engineering
- Marketing
| Task | Group | Start | End | Done |
|---|---|---|---|---|
| User research | Design | 2026-11-02 | 2026-11-08 | 100% |
| Page design | Design | 2026-11-09 | 2026-11-18 | 70% |
| Build the page | Engineering | 2026-11-12 | 2026-11-27 | 35% |
| Checkout and payments | Engineering | 2026-11-19 | 2026-12-04 | 0% |
| Launch copy | Marketing | 2026-11-16 | 2026-11-25 | 20% |
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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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 | 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 | "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.