---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Gantt

A timeline of dated bars for a roadmap, a schedule or a release plan, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `Gantt`.

## Try it

Switch the roadmap between weeks, months and quarters, scroll away and press Today to come back, fold a team (the line under it says which), and press a project’s bar to open it and mark it done (its fill turns full). The arrow keys move between bars; hover a bar for its dates and progress.

The projects are our own sample, placed around today; nothing is saved anywhere.

## When to use

- A timeline of dated bars for a roadmap, a schedule or a release plan.
- Also called: gantt chart or roadmap timeline.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Gantt on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-gantt.json --yes
```

```text
Add the Goop Gantt to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { Gantt, GanttScale, GanttGroup, GanttRow, GanttBar, GanttToolbar, GanttLegend } from '@/components/goop/patterns/gantt';
import { useState } from 'react';
import { SegmentedControl, SegmentedControlItem } from '@/components/ui/goop/segmented-control';

function Roadmap() {
  const PROJECTS = [
    { id: 'search', name: 'Search speed-up', start: '2026-10-05', end: '2026-12-11', hue: 'blue', health: 'on-track', progress: 60 },
    { id: 'push', name: 'Push settings', start: '2026-11-16', end: '2026-11-27', hue: 'red', health: 'off-track', progress: 20 },
  ] as const;
  const [zoom, setZoom] = useState<'week' | 'month' | 'quarter'>('month');
  return (
    <Gantt aria-label="Roadmap" zoom={zoom} from="2026-09-01" to="2027-03-31" todayLabel="Today">
      <GanttToolbar>
        <SegmentedControl aria-label="Zoom" fit value={zoom} onValueChange={(value) => setZoom(value as typeof zoom)}>
          <SegmentedControlItem value="week">Weeks</SegmentedControlItem>
          <SegmentedControlItem value="month">Months</SegmentedControlItem>
          <SegmentedControlItem value="quarter">Quarters</SegmentedControlItem>
        </SegmentedControl>
      </GanttToolbar>
      <GanttScale />
      <GanttGroup label="Platform">
        {PROJECTS.map((one) => (
          <GanttRow key={one.id} label={one.name}>
            <GanttBar
              from={one.start}
              to={one.end}
              label={one.name}
              hue={one.hue}
              health={one.health}
              progress={one.progress}
              href={`/projects/${one.id}`}
            />
          </GanttRow>
        ))}
      </GanttGroup>
      <GanttLegend labels={{ blue: 'Active', red: 'Blocked' }} />
    </Gantt>
  );
}
```

- Fits: list (its recipe); list: collection (time: span).
- Also known as: Roadmap, RoadmapTimeline, GanttChart, TimelineChart, ProjectTimeline.
- Start it with `GanttScale`, then `GanttRow`s holding `GanttBar`s, or `GanttGroup`s of rows; never bars on a grid by hand. It fills its container and scrolls sideways in its own frame. The zoom switch is yours (a `SegmentedControl` holding `zoom`), in a `GanttToolbar` before the scale, which adds the Today button; a `GanttLegend` after the rows names the hues. A bar is a button: its `onClick` opens the record (`RecordPeek`); with `href` (or `asChild` and a router's link) it is a link to the record's page. Its `progress` fills its done share; `markers` draw dated lines.
- height, width, padding, gap, corner, border, background, text, motion: add no class for these.

## API reference

### Parts

- `GanttScale` — The scale header, the gantt's first child; its props: gantt--scale.md
- `GanttGroup` — A group of rows under a header that folds them (a team, a quarter, a milestone); its props: gantt--group.md
- `GanttRow` — One row; its props: gantt--row.md
- `GanttBar` — One bar on its row's track, from `from` to `to` (both days included), as the gantt's own range; its props: gantt--bar.md
- `GanttToolbar` — The gantt's toolbar, its first child; its props: gantt--toolbar.md
- `GanttLegend` — The gantt's legend, its last child; its props: gantt--legend.md

### GanttBar

One bar on its row's track, from `from` to `to` (both days included), as the gantt's own range.

```tsx
import { GanttBar } from '@/components/goop/patterns/gantt';
```

### Options

- from: GanttDate — Its first day, a date (`YYYY-MM-DD` or a `Date`).
- to: GanttDate — Its last day (included), a date (`YYYY-MM-DD` or a `Date`).
- label: string — Its words (a project's name).
- hue?: Exclude<Hue, 'orange' | 'pink'> = 'neutral' — Its colour, a hue that says nothing by itself (a team's, a status's): `blue`, `green`, `yellow`, `red`, the accent `primary`, or the grey `neutral` when left out; the `GanttLegend` says what each means.
- health?: 'on-track' | 'at-risk' | 'off-track' — Its health: a mark before the label, and words in its name.
- healthLabel?: string — The health in your words; `On track`, `At risk` or `Off track` when left out.
- lead?: GanttLead — Who leads it: their avatar at the bar's end.
- progress?: number — How much of it is done, from 0 to 100: the done share keeps its tint, and `40% done` is in its name.
- href?: string — The bar's link (the record's page): the bar is an `<a>`, Enter opens it.
- children?: ReactElement — With `asChild`, the caller's link element (with no children of its own).
- Also takes: asChild?: boolean; onClick?: (event: MouseEvent) => void; disabled?: boolean
- Types: GanttDate = string | Date; GanttLead = { name: string; initials?: string }

### GanttGroup

A group of rows under a header that folds them (a team, a quarter, a milestone).

```tsx
import { GanttGroup } from '@/components/goop/patterns/gantt';
```

### Options

- label: string — The group's name (`Platform`).
- count?: number — A number after the name (its rows, its open items); read with the name.
- open?: boolean — Shown or folded, held by the caller; with `onOpenChange`.
- defaultOpen?: boolean = true — Shown or folded at first, when the caller does not hold it: shown.
- onOpenChange?: (open: boolean) => void — Called with the new state when the header is pressed.

### GanttLegend

The gantt's legend, its last child.

```tsx
import { GanttLegend } from '@/components/goop/patterns/gantt';
```

### Options

- labels?: Partial<Record<Exclude<Hue, 'orange' | 'pink'>, ReactNode>> — Your words for each hue (what blue means here); one left out is named by its colour.

### Gantt: every option

```tsx
import { Gantt } from '@/components/goop/patterns/gantt';
```

### Options

- aria-label: string — The gantt's name (`Roadmap`).
- from: GanttDate — The first day the grid must show; the grid starts at the column holding it.
- to: GanttDate — The last day the grid must show.
- zoom?: 'week' | 'month' | 'quarter' = 'month' — What a column holds: `week`s under months, `month`s under quarters, `quarter`s under years.
- today?: GanttDate | null — The day the today line marks; the current day when left out, none with `null`.
- locale?: string — The language of the scale and the tooltips' dates (a BCP 47 tag; the page's, else the browser's, when left out).
- todayLabel?: string — Words at the today line's head in the scale (`Today`), and the line's name and the Today button's words; no words drawn when left out (the line and the button then say `Today`).
- markers?: readonly GanttMarker[] — Dated dashed lines across the grid (a release, a milestone), their words at their head.
- empty?: ReactNode = 'Nothing on the timeline yet' — The words shown when the gantt holds no rows.
- scrollToToday?: boolean = true — On first showing, scroll the today line into view.
- tooltipContainer?: HTMLElement | null — Where the bars' tooltips are portalled; the end of `<body>` when left out.
- Types: GanttDate = string | Date; GanttMarker = { date: GanttDate; label: string }

### GanttRow

One row.

```tsx
import { GanttRow } from '@/components/goop/patterns/gantt';
```

### Options

- label: ReactNode — The row's name (a project's).
- description?: ReactNode — A second line under it (its team, its target, its count of issues).

### GanttScale

The scale header, the gantt's first child.

```tsx
import { GanttScale } from '@/components/goop/patterns/gantt';
```

### Options

- heading?: ReactNode — The words over the label column (`Project`).

### GanttToolbar

The gantt's toolbar, its first child.

```tsx
import { GanttToolbar } from '@/components/goop/patterns/gantt';
```

### Options

- todayButton?: boolean = true — Draw the Today button at the band's end.
- todayLabel?: string — The Today button's words: the gantt's `todayLabel`, else `Today`.

## Keyboard

- Tab: move to the next group header or bar, group by group, row by row
- ArrowLeft / ArrowRight: move to the bar before or after in the same row
- ArrowUp / ArrowDown: move to the nearest bar of the row above or below
- Home / End: move to the row's first or last bar
- Enter / Space: open the bar, or fold or show a group

## Accessibility

- The native element answers the keyboard.
- hover, focus-visible: the browser's own (:hover, :focus-visible): write nothing

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

Shortened to fit: the data-slot values.

## Related

- [Segmented control](/themes/trail/components/segmented-control): One choice of two to five short options that applies at once — a view or a mode — drawn as touching segments in one pill.
- [Create dialog](/themes/trail/components/create-dialog): A dialog to make a new record, title first.
- [Invite dialog](/themes/trail/components/invite-dialog): Send an invite to people by their email addresses, with a role and an optional note.
- [Auth page](/themes/trail/components/auth-page): A page outside the app frame, for a person not yet inside the app.
