Skip to content

Components

GanttChart: a project schedule with its links and key dates

GanttChart is the kit's project plan: tasks as bars over weeks, grouped in phases, linked finish to start, with today, the key dates and the critical path drawn on it. Bars move by drag or with Alt and the arrow keys, and a move that breaks a link turns the link red and is announced, while the app decides what that means.

By Bohuslav PoláčekChecked

Stonebridge's schedule for the Vinery Court flats on Wednesday 2 December 2026, in weeks: the key dates folded, block A's structure and the building services with their links, today and the weekly site meetings.

What it is for, and what the preview shows

A plan that is dates, phases and "this waits for that": a building site, an agency's project, a fit-out. The preview is Stonebridge's schedule for the Vinery Court flats as the demo shows it on Wednesday 2 December 2026, three of its eight groups with the demo's own tasks. Block A's formwork is 60% done and ends today, the rebar inspection is a milestone tomorrow, the slab pour carries the weather warning as its tone, and the plumbing and electrics for floors 3 to 4 are on the critical path, drawn with a firmer edge.

The thin lines are the finish-to-start links; the vertical lines are today and the site meeting every Wednesday, listed as key dates in a lane under the weeks. The key dates group is folded, as the demo folds it, because its diamonds sit months away. In the app the chart opens scrolled to today; a static page cannot scroll, so the preview starts two weeks before. The screen around it is the construction schedule.

The rules, and where they live

  • The manifest: use it for planning a project over weeks or months; not for hours within a day, which is ResourceTimeline. It replaces "a Gantt library" and "a hand-built timeline".
  • AGENTS.md, Apps do work: planning views are editors, with drag, copy, live feedback and the same from the keyboard. The chart carries the moves; the app says what a move means.
  • AGENTS.md, Charts: timelines and calendars show now and today, the line under the blocks.
  • docs/patterns.md, Time and planning: bars in phases, finish-to-start links, today, key dates and the critical path; drag, Alt and the arrows; a broken dependency shown and said aloud.
  • docs/principles.md, page widths: a timeline scrolls inside itself and never scrolls the page.
  • The props type: today is a prop, and the chart never reads the clock, so a plan draws the same in a test, a screenshot and a review.

What AI coding tools write instead

A Gantt library, or a timeline of absolutely positioned bars, as the manifest's replaces names them. What goes wrong:

  • The library brings its own colours, fonts and arrows, so the plan looks like another product inside the app, and its bars are coloured by whatever the library picks rather than by trade or status.
  • A move that breaks a dependency is either silently allowed or silently pushed, and nobody is told. The kit draws the broken link in red, says "Dependency broken" aloud, and leaves the decision to onChange.
  • Text on coloured bars fails contrast. The kit writes bar labels in ink: on the hue fills, the hue's own text colour measured 3.6 to 4.4:1 in light mode, ink holds 9.7:1 or more.
  • Long task names are cut. The kit's label column is 260px (140px on a phone), every name is repeated there, and a cut name shows in full on hover.
  • A hand-built timeline scrolls with overflow-auto, which the markup check own-scroll (scripts/check-markup.mjs) flags in an app.

How to use it

  • items: GanttItem objects with ISO start and an inclusive end, a group, progress from 0 to 1, hue for identity or tone for status, milestone for a one-day diamond, dependsOn for the tasks that must finish first, locked for one that opens but never moves.
  • groups: phases with sticky headers and a quiet summary bar; defaultCollapsed folds one at first.
  • from, to and scale (day 32px a day, week 12px, month 4px); today and markers for the key dates; critical for the ids on the critical path.
  • onChange({ id, start, end }) makes bars draggable and their ends resizable, snapping to days; onOpen opens a task; selectedId rings the one in the side panel.
  • renderBarLabel(item, { inside, width }) writes the bar's words, such as the progress when the label fits inside.
  • corner and empty fill the top-left cell and the view with no tasks.

Its entry in the manifest

The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

Where it runs in the example apps

The example apps whose code renders a GanttChart, and the modules it sits in.Read from the demo's source when the site was built: 2 of 9 example apps render <GanttChart>, in the modules named here as each app's sidebar names them.

How the demo calls it

apps/demo/src/modules/schedule/components/schedule-board.tsx
<GanttChart
  key={`${site.id}-${scale}-${filter}`}
  label={tx(`Harmonogram, ${site.name}`, `Schedule, ${site.name}`)}
  className="h-full"
  items={items}
  groups={groups}
  from={range.from}
  to={range.to}
  scale={scale}
  today={today}
  markers={markers}
  critical={critical}
  selectedId={peek ?? null}
  corner={tasksLabel(shown.length)}
  empty={
    <>
      <p>{tx("Žádná práce neodpovídá tomuto zobrazení.", "No work matches this view.")}</p>
      <Button onClick={() => setParam("filtr", null)}>{tx("Zobrazit všechny práce", "Show all work")}</Button>
    </>
  }
  onChange={editable ? onChart : undefined}
  onOpen={openTask}
  ghosts={ghosts}
  renderBarLabel={(item, state) =>
    state.inside && item.progress && item.progress > 0 && item.progress < 1 && !item.milestone
      ? `${item.label} · ${Math.round(item.progress * 100)} %`
      : item.label
Stonebridge's call: groups, range, key dates and the critical path come from the module, onChange only for people who may edit, and the bar label adds the progress when it fits inside.

The task it draws

packages/kit/src/components/gantt-chart.tsx
export type GanttItem = {
  id: string;
  /** The task's name: in the left column, on the bar and in its accessible name. */
  label: string;
  /** The first day of work, ISO ("2026-10-21"). */
  start: string;
  /** The last day of work, ISO and inclusive: a one-day task has the same start and end. */
  end: string;
  /** The id of a group in `groups`. */
  group?: string;
  /** How much is done, 0 to 1: a darker fill from the left edge. */
  progress?: number;
  /** Identity colour (a team, a trade, a phase). Without `hue` and `tone` the bar is grey. */
  hue?: HueName;
  /** Status colour; wins over `hue`. */
  tone?: GanttTone;
  /** A one-day diamond (an inspection, a handover): `start` is its day, progress 1 means reached. */
  milestone?: boolean;
  /** Ids of tasks that must finish before this one starts (finish to start). */
  dependsOn?: string[];
  /** The task opens but never moves or changes length (started, signed off); no grips on its bar. */
  locked?: boolean;
};
The kit's exported item type: ISO days with an inclusive end, a hue for identity, a tone for status.

Questions

Can a task be moved without a mouse?

Yes. With a bar focused, Alt and the left or right arrow move the task by a day, and adding Shift changes its end. The up and down arrows go to the next task and Enter opens it. Each change is announced with the new dates.

What happens when a move breaks a dependency?

The link turns red and the chart announces that the task now starts before the one it waits for ends. The move itself is allowed: the app decides whether that is a warning, a push of the tasks after it or a refusal.

How does the chart show the critical path?

The app passes the ids of the critical tasks. Their bars get a firmer edge in their colour all round, and a link between two critical tasks is drawn firmer than the others.

Does it work on a phone?

It reads on a phone: the label column narrows to 140px and the timeline scrolls sideways inside its own frame. A swipe scrolls rather than drags, so dates are changed in the task's panel there.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app