Gantt Chart

A composable Gantt timeline with dependencies, progress, a Today reveal, panning and pinch zoom

Preview
Trialing
Active
Upgraded
Paused
Past due
Scheduled
Customer
Oct
Nov
Jan
Feb
Mar
  • Relay SystemsHobby · $9/month
  • Coral LabsTeam · $49/month
  • Solstice RoboticsHobby · $9/month
  • Obsidian StudioPro · $29/month
  • Mira AIHobby → Pro · $29/month
  • Lumen AITeam · $49/month
  • Halcyon WorksPro Yearly · $290/year
  • Brightline StudioTeam · $49/month
  • Vertex StudioHobby · $9/month
  • Atlas RoboticsPro · $29/month
  • Kestrel LabsTeam · $49/month
  • Tandem CloudTeam · $49/month
  • Orbit HealthHobby · $9/month
  • Quartz SystemsPro · $29/month
  • Pyon AnalyticsHobby · $9/month
Nov 16
‹ Nov 16
From Nov 16 ›
Nov 19
‹ Nov 19
From Nov 19 ›
Nov 21
‹ Nov 21Ends Dec 20
‹ Nov 21 to Dec 20Nov 21 to Dec 20 ›
Nov 25
‹ Nov 25
From Nov 25 ›
Nov 4
‹ Nov 4
From Nov 4 ›
Dec 10
Starts Dec 10
‹ Dec 10
From Dec 10 ›
Oct 22
‹ Oct 22
From Oct 22 ›
Nov 13
‹ Nov 13Ends Dec 7
‹ Nov 13 to Dec 7Nov 13 to Dec 7 ›
Oct 12
‹ Oct 12Ends Dec 9
‹ Oct 12 to Dec 9Oct 12 to Dec 9 ›
Nov 9
‹ Nov 9
From Nov 9 ›
Dec 4
‹ Dec 4
From Dec 4 ›
Nov 2
‹ Nov 2Ended Nov 23
‹ Nov 2 to Nov 23Nov 2 to Nov 23 ›
Sep 22
‹ Sep 22
From Sep 22 ›
Nov 7
‹ Nov 7Ends Dec 24
‹ Nov 7 to Dec 24Nov 7 to Dec 24 ›
Sep 23
‹ Sep 23Ended Oct 23
‹ Sep 23 to Oct 23Sep 23 to Oct 23 ›
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
Mar 1
Mar 8
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
24 Wed
25 Thu
26 Fri
27 Sat
28 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue

Installation

pnpm dlx shadcn@latest add @bklit/gantt-chart

Usage

GanttChart is composed like every other bklit chart: a root that owns the data and the visible range, and parts that read it. Leave out any part you don't need.

import {
  GanttAxis,
  GanttBars,
  GanttChart,
  GanttGrid,
  GanttLabels,
  GanttToday,
  GanttTooltip,
} from "@bklitui/ui/charts";

const data = [
  {
    id: "relay",
    name: "Relay Systems",
    segments: [
      { kind: "trial", start: "2026-11-16", end: "2026-11-30" },
      { kind: "active", start: "2026-11-30", end: null }, // null = still running
    ],
  },
  { id: "coral", name: "Coral Labs", start: "2026-11-19", end: "2026-12-20" },
];

const config = {
  trial: { label: "Trialing", pattern: "diagonal-up" },
  active: { label: "Active", color: "var(--chart-1)" },
};

export function Subscriptions() {
  return (
    <GanttChart data={data} config={config}>
      <GanttLabels title="Customer" />
      <GanttAxis position="top" />
      <GanttToday />
      <GanttGrid />
      <GanttBars />
      <GanttAxis position="bottom" />
      <GanttTooltip />
    </GanttChart>
  );
}

Data

Rows are plain objects. A row is either one bar (start / end) or several phases (segments). Dates can be Dates, ISO strings ("2026-12-01" is read as a local date) or timestamps. end is exclusive (a segment from Dec 1 to Dec 3 covers Dec 1 and 2), a same-day segment still covers its day, and end: null means open-ended: the bar runs past the right edge.

interface Row {
  id: string;
  name: string;
  start?: Date | string | number;
  end?: Date | string | number | null;
  segments?: { start; end: … | null; kind?: string; progress?: number }[]; // wins over start/end
  progress?: number; // 0–1, spread over the row's span
  dependencies?: Array<string | { id: string; type?: "FS" | "SS" | "FF" | "SF" }>;
  // …any fields your labels / tooltip need, available as `row.datum`
}

Different field names? Map them with idKey, nameKey, startKey, endKey, segmentsKey, progressKey and dependenciesKey, the same way xDataKey works on the cartesian charts.

Dependencies and progress

Link shape
Corners
Line style
Arrowheads
Research
Design
Build
QA
Launch
Task
Oct
Nov
Jan
Feb
Mar
  • DiscoveryResearch
  • WireframesDesign
  • Billing APIPlatform
  • Visual designDesign
  • FrontendWeb
  • DocsDevRel
  • QA passQuality
  • LaunchMarketing
‹ Nov 28
‹ Nov 28 to Dec 4Nov 28 to Dec 4 ›
60%
‹ Dec 4
‹ Dec 4 to Dec 9Dec 4 to Dec 9 ›
25%
‹ Dec 5
‹ Dec 5 to Dec 15Dec 5 to Dec 15 ›
‹ Dec 9
‹ Dec 9 to Dec 14Dec 9 to Dec 14 ›
‹ Dec 15
‹ Dec 15 to Dec 22Dec 15 to Dec 22 ›
‹ Dec 13
‹ Dec 13 to Dec 22Dec 13 to Dec 22 ›
‹ Dec 22
‹ Dec 22 to Dec 26Dec 22 to Dec 26 ›
‹ Dec 26
‹ Dec 26 to Dec 28Dec 26 to Dec 28 ›
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
Mar 1
Mar 8
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
24 Wed
25 Thu
26 Fri
27 Sat
28 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue

A row's dependencies name its predecessors by id. A plain string is finish → start; pass { id, type } for start → start ("SS"), finish → finish ("FF") or start → finish ("SF"). GanttDependencies draws them as SVG paths, recomputed on every zoom frame without re-rendering. Put it before GanttBars so links pass behind other rows' bars. Hovering a row brightens its links and fades the rest.

<GanttDependencies corner="round" cornerRadius={6} /> {/* step, rounded corners */}
<GanttDependencies corner="bevel" />                  {/* step, angled (chamfered) corners */}
<GanttDependencies corner="miter" />                  {/* step, square corners */}
<GanttDependencies curve="bump" />                    {/* smooth S-curves */}
<GanttDependencies strokeDasharray="4 4" />           {/* dashed; selected ones flow */}
<GanttDependencies markerEnd="none" />                {/* no arrowheads */}

Selecting and connecting

Click a bar to select it. Each segment is its own bar, so a row with three phases has three selectable bars. The selected bar gets a foreground border, and the links attached to it switch to the active colour (the destructive red, like Deadline). Dashed links (strokeDasharray) also flow: their dashes march toward the connected bar. Clicking empty plot or pressing Escape clears the selection. Selection is uncontrolled by default; control it with selected / onSelectedChange ({ rowId, segment } | null), or turn it off with selectable={false}.

Links always run from the predecessor's end into the successor's start, drawing in with the intro once the rows in view have started.

Pass onConnect to GanttDependencies to let people draw dependencies. Hovering near a bar's start shows a small handle just before it ("Drag to add dependency"), drawn above the bars. Drag from it onto another bar to make that bar its predecessor (finish → start). The chart doesn't change your data; add the dependency in the callback:

const [tasks, setTasks] = useState(initialTasks);

<GanttDependencies
  onConnect={({ source, target }) =>
    setTasks((all) =>
      all.map((t) =>
        t.id === target
          ? { ...t, dependencies: [...(t.dependencies ?? []), source] }
          : t
      )
    )
  }
/>

With onDisconnect, the selected bar's links get a small remove button halfway along each line; the callback gets the link to remove from your data.

Link colours come from two CSS variables, so a theme can restyle them without props:

:root {
  --chart-link: oklch(0.55 0.01 260);        /* resting links */
  --chart-link-active: var(--chart-negative); /* selected links + remove button */
}

Without them, links fall back to --chart-foreground and --chart-negative (the same red as Deadline). The selected bar's border uses the foreground colour.

progress (0–1) on a row is spread across the row's span; a segment's own progress wins. The done part keeps its fill and the rest fades to progressRemainingOpacity, with a sweep on intro. segmentLabel receives the row, so a check icon or a percentage is one line.

Weekends, deadlines and grid

GanttWeekends and GanttDeadline take the same props as Weekends and Deadline, positioned in the Gantt's day space so they slide with zooms and the Today reveal. Weekend bands fade out once a day is narrower than minDayWidth.

GanttGrid draws month, week and day lines (week and day fade in by density). fadeVertical (true, "top" or "bottom") fades them toward the edges, strokeDasharray ("3 3") makes them dashed, horizontal adds row dividers and stroke recolours every line.

<GanttWeekends fillType="pattern" pattern="diagonal-up" />
<GanttGrid fadeVertical strokeDasharray="3 3" />
<GanttDeadline date={freeze} fillType="gradient" label="Code freeze" />

Bar fills

Each segment's kind looks up its style in config. A kind can be a solid colour, a gradient, a bklit pattern, an outline, or a mix. Layers paint fill → pattern → stroke. Patterns are drawn in user space, so they never stretch with the bar.

const config = {
  trial: { label: "Trialing", pattern: "diagonal-up" },
  active: { label: "Active", color: "color-mix(in oklab, var(--chart-foreground) 38%, transparent)" },
  upgrade: { label: "Upgraded", gradient: { from: "var(--chart-2)", to: "var(--chart-1)" } },
  scheduled: { label: "Scheduled", stroke: "var(--chart-foreground)", strokeStyle: "dashed" },
  tentative: {
    label: "Tentative",
    pattern: "diagonal-down",
    patternColor: "var(--chart-1)",
    stroke: "var(--chart-1)",
    strokeStyle: "dashed",
  },
  default: { color: "var(--chart-1)" }, // segments with no kind
} satisfies GanttConfig;
Project
Sep
Oct
Nov
Jan
Feb
Mar
  • Billing v2Payments
  • Usage alertsGrowth
  • SSOPlatform
  • Mobile appMobile
  • Audit logPlatform
  • OnboardingGrowth
‹ Nov 11
‹ Nov 11 to Dec 17Nov 11 to Dec 17 ›
‹ Nov 23
‹ Nov 23 to Dec 21Nov 23 to Dec 21 ›
‹ Nov 6
‹ Nov 6 to Dec 8Nov 6 to Dec 8 ›
‹ Dec 5
From Dec 5 ›
‹ Nov 17
‹ Nov 17 to Dec 10Nov 17 to Dec 10 ›
‹ Nov 28
‹ Nov 28 to Dec 25Nov 28 to Dec 25 ›
Aug 31
Sep 7
Sep 14
Sep 21
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
Mar 1
Mar 8
25 Tue
26 Wed
27 Thu
28 Fri
29 Sat
30 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
24 Wed
25 Thu
26 Fri
27 Sat
28 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
KeyTypeDescription
labelstringLegend and tooltip label. Default: the kind key
colorstringSolid fill. With a pattern, it becomes a faint wash under it
gradient{ from, to, angle? } | stringLinear gradient fill (wins over color). A CSS gradient string also works
opacitynumberFill opacity
patternPatternPresetIdAny bklit pattern preset, drawn over the fill
patternColorstringPattern colour. Default: color, else muted foreground
patternScalenumberPattern tile scale
patternStrokeWidthnumberLine width for line presets. Default: 1.25
strokestring1px outline
strokeStyle"solid" | "dashed"Outline style
classNamestringEscape hatch on the segment element

Today, scales and zoom

GanttToday puts a chip on the month row ("‹ Today · Dec 1"). Clicking it reveals the previous period: the previous week on the week scale, or back to the 1st of last month on the month scale. The right edge stays put. Revealed, the chip becomes a solid pill on a today line that runs unbroken through every row.

GanttScaleToggle switches between week (14 days) and month (28 days). Both animate the visible range and can interrupt each other: the Today reveal over 450ms (cubic-bezier(0.32, 0.72, 0, 1)), and a zoom faster, over 300ms with a strong ease-out (cubic-bezier(0.23, 1, 0.32, 1), the same curve as the toggle's sliding pill). Ticks never swap: they slide, and each tier (month / week / day) fades in by how many pixels its unit gets.

Both are controlled or uncontrolled, with React-style names:

StateControlledUncontrolledChange
Zoom presetscaledefaultScale ("month")onScaleChange
Today revealrevealeddefaultRevealed (false)onRevealedChange

Put your own toolbar outside the chart by controlling both:

week · from today
Customer
Oct
Nov
Jan
Feb
  • Relay Systems
  • Coral Labs
  • Solstice Robotics
  • Obsidian Studio
  • Mira AI
  • Lumen AI
Nov 16
‹ Nov 16
From Nov 16 ›
Nov 19
‹ Nov 19
From Nov 19 ›
Nov 21
‹ Nov 21
‹ Nov 21 to Dec 20Nov 21 to Dec 20 ›
Nov 25
‹ Nov 25
From Nov 25 ›
Nov 4
‹ Nov 4
From Nov 4 ›
Dec 10
‹ Dec 10
From Dec 10 ›
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
const [scale, setScale] = useState<GanttScaleName>("week");
const [revealed, setRevealed] = useState(false);

<GanttScaleToggle value={scale} onValueChange={setScale} />
<GanttChart scale={scale} onScaleChange={setScale} revealed={revealed} onRevealedChange={setRevealed} …>

Labels column

GanttLabels is an optional row-header column. It stays aligned to the rows, blurs in with them and dims with the hover. What goes in it is up to you: the subscriptions example renders customer + plan, and the schedule example has no column at all. Its render prop gets the normalized row; your original object is on row.datum.

<GanttLabels<Customer> title="Customer" width={232}>
  {(row) => (
    <>
      <GanttLabel>{row.name}</GanttLabel>
      <GanttLabelDescription>{row.datum.plan}</GanttLabelDescription>
    </>
  )}
</GanttLabels>

Plot only

Ana
Ana
‹ Dec 1
‹ Dec 1 to Dec 20Dec 1 to Dec 20 ›
Bo
Bo
‹ Dec 6
‹ Dec 6 to Dec 27Dec 6 to Dec 27 ›
Chen
Chen
‹ Dec 3
‹ Dec 3 to Dec 15Dec 3 to Dec 15 ›
Dee
‹ Dec 15
‹ Dec 15 to Dec 22Dec 15 to Dec 22 ›
Release
Release
‹ Dec 10
‹ Dec 10 to Dec 27Dec 10 to Dec 27 ›
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
Mar 1
Mar 8
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
24 Wed
25 Thu
26 Fri
27 Sat
28 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue

Legend

There's no Gantt-specific legend. Use bklit's Legend with ganttLegendItems(config), and GanttLegendMarker to draw each kind's real fill (gradient, pattern, outline). Link it to the chart with highlightedKind, which dims every other kind:

const items = ganttLegendItems(config);
const [highlighted, setHighlighted] = useState<string | null>(null);

<Legend
  items={items}
  className="flex-row"
  onHoverChange={(i) => setHighlighted(i === null ? null : items[i].kind)}
>
  <LegendItem className="flex items-center gap-1.5">
    <GanttLegendMarker config={config} />
    <LegendLabel />
  </LegendItem>
</Legend>

<GanttChart highlightedKind={highlighted} …>

Or build anything from the hooks. useGantt() exposes config, rows, scale, setScale, revealed, setRevealed and the viewport motion values, and GanttSwatch renders any kind's fill on its own.

Hover

GanttTooltip is bklit's standard hover, made of the same parts as ChartTooltip: a crosshair line (TooltipIndicator), a rolling date pill (DateTicker) on the bottom axis, and a bubble (TooltipBox) beside the hovered row. Ticks on the bottom axis fade out near the pill, as on the other charts. Turn the pill off (showDatePill={false}) and the axis highlights the hovered day's tick instead (see the plot-only example). Pass content for your own bubble:

<GanttTooltip<Customer>
  content={({ row, segment, date }) => (
    <>
      <TooltipHeader>{row.name}</TooltipHeader>
      …
    </>
  )}
/>

Panning and zooming

Swipe sideways on a trackpad, Shift + scroll, or drag the plot to move through time. A drag glides on with inertia. Panning stops a week past the first and last bars. Once today is out of view, the Today chip pins to the edge with its chevron pointing back; click it to glide back to today. Bars outside the view leave a small pill at the plot edge ("‹ Sep 23 to Oct 23", "Feb 3 to Mar 1 ›"), so there's always a hint that there's more to the left or right.

Pinch to zoom: a trackpad pinch (or Ctrl + scroll), a Safari gesture, or two fingers on a touch screen widens or narrows the visible range around the point between your fingers, from about a week to about six months. The response is damped so small pinches make small changes, and day, week and month labels fade in and out by density as you go. Picking Week or Month in the toggle resets the zoom. After any pan or pinch, the Today chip's first click glides back to today's view (no pan, no zoom), and the next one toggles the reveal as usual; a reveal always starts from today's view.

Ticks, gridlines and weekend bands only render around the visible range, re-snapped every two weeks as you pan, so a timeline spanning years costs the same as one month. Pass pannable={false} for a fixed view. The large-data example below spans nine months, so try panning into the future there.

Large data

2,000 rows · 16 rendered · drag or swipe to pan
Task
Oct
Nov
Jan
Feb
Mar
  • Atlas 1 · DiscoveryPlatform
  • Atlas 1 · WireframesPlatform
  • Atlas 1 · Visual designPlatform
  • Atlas 1 · APIPlatform
  • Atlas 1 · FrontendPlatform
  • Atlas 1 · IntegrationsPlatform
  • Atlas 1 · QA passPlatform
  • Atlas 1 · LaunchPlatform
  • Beacon 1 · DiscoveryWeb
  • Beacon 1 · WireframesWeb
  • Beacon 1 · Visual designWeb
  • Beacon 1 · APIWeb
  • Beacon 1 · FrontendWeb
  • Beacon 1 · IntegrationsWeb
  • Beacon 1 · QA passWeb
  • Beacon 1 · LaunchWeb
‹ Oct 17
‹ Oct 17 to Oct 22Oct 17 to Oct 22 ›
‹ Oct 23
‹ Oct 23 to Oct 31Oct 23 to Oct 31 ›
‹ Nov 2
‹ Nov 2 to Nov 7Nov 2 to Nov 7 ›
‹ Nov 8
‹ Nov 8 to Nov 15Nov 8 to Nov 15 ›
‹ Nov 9
‹ Nov 9 to Nov 18Nov 9 to Nov 18 ›
‹ Nov 18
‹ Nov 18 to Nov 26Nov 18 to Nov 26 ›
‹ Nov 28
‹ Nov 28 to Dec 6Nov 28 to Dec 6 ›
‹ Dec 6
‹ Dec 6 to Dec 8Dec 6 to Dec 8 ›
‹ Nov 9
‹ Nov 9 to Nov 17Nov 9 to Nov 17 ›
‹ Nov 19
‹ Nov 19 to Nov 26Nov 19 to Nov 26 ›
‹ Nov 27
‹ Nov 27 to Dec 7Nov 27 to Dec 7 ›
‹ Dec 7
‹ Dec 7 to Dec 16Dec 7 to Dec 16 ›
‹ Dec 16
‹ Dec 16 to Dec 21Dec 16 to Dec 21 ›
‹ Dec 23
‹ Dec 23 to Jan 2Dec 23 to Jan 2 ›
‹ Dec 23
‹ Dec 23 to Jan 2Dec 23 to Jan 2 ›
‹ Jan 3
‹ Jan 3 to Jan 5Jan 3 to Jan 5 ›
Sep 28
Oct 5
Oct 12
Oct 19
Oct 26
Nov 2
Nov 9
Nov 16
Nov 23
Nov 30
Dec 7
Dec 14
Dec 21
Dec 28
Jan 4
Jan 11
Jan 18
Jan 25
Feb 1
Feb 8
Feb 15
Feb 22
Mar 1
Mar 8
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
1 Thu
2 Fri
3 Sat
4 Sun
6 Tue
7 Wed
8 Thu
9 Fri
10 Sat
11 Sun
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat
18 Sun
20 Tue
21 Wed
22 Thu
23 Fri
24 Sat
25 Sun
27 Tue
28 Wed
29 Thu
30 Fri
31 Sat
1 Sun
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
8 Sun
10 Tue
11 Wed
12 Thu
13 Fri
14 Sat
15 Sun
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
24 Tue
25 Wed
26 Thu
27 Fri
28 Sat
29 Sun
1 Tue
2 Wed
3 Thu
4 Fri
5 Sat
6 Sun
8 Tue
9 Wed
10 Thu
11 Fri
12 Sat
13 Sun
15 Tue
16 Wed
17 Thu
18 Fri
19 Sat
20 Sun
22 Tue
23 Wed
24 Thu
25 Fri
26 Sat
27 Sun
29 Tue
30 Wed
31 Thu
1 Fri
2 Sat
3 Sun
5 Tue
6 Wed
7 Thu
8 Fri
9 Sat
10 Sun
12 Tue
13 Wed
14 Thu
15 Fri
16 Sat
17 Sun
19 Tue
20 Wed
21 Thu
22 Fri
23 Sat
24 Sun
26 Tue
27 Wed
28 Thu
29 Fri
30 Sat
31 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue
10 Wed
11 Thu
12 Fri
13 Sat
14 Sun
16 Tue
17 Wed
18 Thu
19 Fri
20 Sat
21 Sun
23 Tue
24 Wed
25 Thu
26 Fri
27 Sat
28 Sun
2 Tue
3 Wed
4 Thu
5 Fri
6 Sat
7 Sun
9 Tue

2,000 tasks, with only the rows in view rendered. bodyHeight caps the rows area: rows scroll under fixed axes and a fixed Today line. rowWindow tells the chart which rows to render; the plot stays sized for every row, so the scrollbar is right. The chart doesn't bundle a virtualizer, so bring your own. Here, TanStack Virtual uses the chart's scrolling body (bodyRef) as its scroll element:

import { useVirtualizer } from "@tanstack/react-virtual";

const bodyRef = useRef<HTMLDivElement>(null);
const virtualizer = useVirtualizer({
  count: tasks.length,
  getScrollElement: () => bodyRef.current,
  estimateSize: () => 36, // = rowHeight
  overscan: 8,
});
const items = virtualizer.getVirtualItems();
const rowWindow = items.length
  ? { start: items[0].index, end: items.at(-1).index + 1 }
  : { start: 0, end: 16 }; // before the first measure (SSR)

<GanttChart
  data={tasks}
  rowHeight={36}
  bodyHeight={480}
  bodyRef={bodyRef}
  rowWindow={rowWindow}
>
  …
</GanttChart>

Only rows in the window render bars, labels and row dividers. Dependency links render when they cross the window. The intro plays for the rows on screen at load, and rows scrolled in later appear without it.

Hooks

HookReturns
useGantt()rows, config, today, scale / setScale, revealed / setRevealed, t0 / t1 (viewport motion values, day offsets from today), pan (motion value, days) / panDirection / resetPan(), horizon (rendered day range), rowHeight, barHeight, plotWidth
useGanttHover(){ row, day, x } | null, the hovered row index, day offset and plot x

Pure helpers are exported for custom parts and tests: GANTT_SCALES, ganttScaleViewport, ganttTierTicks, ganttTierOpacity, ganttZoomRange, normalizeGanttRows, ganttLinkPath / ganttElbowPath, ganttSegmentProgress and ganttWeekendRuns.

Components

GanttChart

PropTypeDefaultDescription
dataT[]requiredRows
configGanttConfig{}Segment kind → fill / label
todayDate | string | numberthe viewer's local dayWithout it, the server renders a sized placeholder and the chart appears once the browser knows its local day. Pass a fixed date to render on the server
scale / defaultScale / onScaleChange"week" | "month""month"Zoom preset
revealed / defaultRevealed / onRevealedChangebooleanfalseToday reveal
scalesGanttScaleName[]allScales offered to the toggle
rowHeightnumber44Row height, px
barHeightnumber20Bar height, px
highlightedKindstring | nullnullDim every other kind
animatebooleantruePlay the intro (rows wipe in, staggered)
bodyHeightnumber—Max height of the rows area, px. Rows scroll under fixed axes
bodyRefRef<HTMLDivElement>—The scrolling rows element (a virtualizer's scroll element)
rowWindow{ start, end }all rowsRender only rows [start, end)
pannablebooleantrueTrackpad / Shift + wheel / drag panning with inertia, bounded to the data, and pinch zoom
selected / defaultSelected / onSelectedChange{ rowId, segment } | nullnullSelected bar (click one)
selectablebooleantrueClick a bar to select it
idKey / nameKey / startKey / endKey / segmentsKeystringfield namesMap your fields

Other div props (className, style, aria-*) pass through to the root.

GanttBars

PropTypeDefaultDescription
trackbooleantrueRounded track hugging each row's bars
trackPaddingnumber4Track padding, px. Track radius = radius + this
radiusnumber5Segment corner radius
gapnumber3Gap between adjacent segments
dimOnHoverbooleantrueFade other rows while one is hovered
startLabelboolean | (row) => ReactNodetrueLabel left of the bar (start date)
endLabelboolean | (row) => ReactNode—Label right of the bar
segmentLabel(segment, row) => ReactNode—Content inside a segment
notches(row) => Date[]—Thin marks inside segments (renewals, milestones)
showProgressbooleantrueDraw progress from the data
progressRemainingOpacitynumber0.35Opacity of the not-yet-done part

GanttDependencies

PropTypeDefaultDescription
curve"step" | "bump""step"Orthogonal runs, or one smooth S-curve
corner"round" | "bevel" | "miter""round"Elbow shape, named after SVG stroke-linejoin: curved, angled (45° chamfer) or square
cornerRadiusnumber6How far each corner is cut back, px
stubnumber10Horizontal run out of / into a bar before turning
strokestringvar(--chart-link)Line and marker colour
strokeWidthnumber1.5
strokeOpacitynumber0.51 on the hovered row's links
strokeDasharraystringsolide.g. "4 3"
strokeLinecap"butt" | "round" | "square""round"
markerStart"dot" | "none""none"Marker on the predecessor
markerEnd"arrow" | "dot" | "none""arrow"Marker on the successor
markerSizenumber6px
gapnumber3Match GanttBars gap so links meet bar edges
highlightOnHoverbooleantrueBrighten the hovered row's links, fade the rest
activeStrokestringvar(--chart-link-active)Links attached to the selected bar
activeStrokeDasharraystringstrokeDasharrayDashes on the selected bar's links
flowbooleantrueA selected dashed link's dashes flow toward the successor (off under reduced motion)
onConnect({ source, target, type }) => void—Show the connect handle before each bar's start; called when a drag ends on another bar
onDisconnect({ source, target, type }) => void—Show a remove button at the middle of the selected bar's links

GanttAxis

PropTypeDefaultDescription
position"top" | "bottom""bottom"Top hosts the month row and the Today chip
tiers("month" | "week" | "day")[]top ["month"], bottom ["week", "day"]Tick tiers (density-faded)
formatLabel(date, tier) => string—Custom tick text
hoverEffect"auto" | "fade" | "highlight" | "none""auto"Same as XAxis. fade hides labels under and near the date pill. highlight lights the hovered day's label (shown even when its tier is faded) and blends nearby labels. auto = fade with a date pill, else highlight (bottom axis)
tickerHalfWidthnumber50fade: half the pill width, px
activeLabelColor / nearbyLabelColorstringvar(--chart-indicator-color)highlight colours
highlightRadiusnumber80highlight: blend distance, px

GanttGrid, GanttToday, GanttScaleToggle, GanttTooltip

ComponentProps
GanttGridtiers (default all three; week and day lines fade in by density), fadeVertical (boolean | "top" | "bottom"), strokeDasharray, stroke, horizontal
GanttWeekendsSame as Weekends: weekendDays, fillType, fill, fillOpacity, pattern, patternScale, patternStrokeWidth, minDayWidth
GanttDeadlineSame as Deadline: date, endDate, color, fillType, fade, fadeLength, stroke*, label, labelPosition …
GanttTodaylabel ("Today"), showDate (true)
GanttScaleTogglevalue / onValueChange (optional; defaults to the chart's scale), scales, formatLabel
GanttTooltipcontent, showCrosshair, showDatePill, showBubble, datePillVariant, animate (false snaps the crosshair and pill to each day, no easing)
GanttLabelstitle, width (232), children render prop
GanttHeaderToolbar row inside the chart (title, toggle, legend)

Accessibility

  • The Today chip is a button whose accessible name starts with its visible text and says what a click does ("Today, show November", "Today, hide previous week").
  • GanttScaleToggle is a fieldset of toggle buttons (aria-pressed), and the arrow keys move between scales.
  • Status isn't colour-only: kinds can carry a pattern or an outline, and the tooltip names the status.
  • Under prefers-reduced-motion the intro is skipped and every viewport change jumps.

See the charts gallery for more examples.