Skip to content
Workflow & operationsGenerated from the public API

GanttChart

Show sequence, schedule or attribution over rows you prepared.

@luc/ui/charts

What it shows

Show tasks on a real time axis, including duration and progress where the caller supplies it.

Live preview

Four tasks on a real time axis, with progress drawn inside each bar rather than implied.

<GanttChart
  tasks={[
    { id: "t1", name: "Scope", start: 1791158400000, end: 1791504000000, progress: 1 },
    { id: "t2", name: "Build", start: 1791504000000, end: 1792368000000, progress: 0.7 },
    { id: "t3", name: "Review", start: 1792195200000, end: 1792713600000, progress: 0.2 },
    { id: "t4", name: "Release", start: 1792800000000, end: 1792972800000 },
  ]}
  axisLabel="Weeks"
  timeFormat={{ kind: "date" }}
  height={300}
  ariaLabel="Delivery schedule"
/>

Controls

Height

300px

A chart measures its container, so it always needs a definite height.

State

The surface the chart is in — loading, empty and error are drawn by the component.

Accessible name

A drawing is not readable by a screen reader, so it needs a name that states what it shows.

The same fixture as the live preview above; the controls change how it is drawn, not what it measures.

Code
import { GanttChart } from "@luc/ui/charts";

<GanttChart
  tasks={[
    { id: "t1", name: "Scope", start: 1791158400000, end: 1791504000000, progress: 1 },
    { id: "t2", name: "Build", start: 1791504000000, end: 1792368000000, progress: 0.7 },
    { id: "t3", name: "Review", start: 1792195200000, end: 1792713600000, progress: 0.2 },
    { id: "t4", name: "Release", start: 1792800000000, end: 1792972800000 },
  ]}
  axisLabel="Weeks"
  timeFormat={{ kind: "date" }}
  height={300}
  ariaLabel="Delivery schedule"
  state="ready"
/>

Not controllable here

  • series / rows — The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `GanttChart` from Luc UI. It is: Show sequence, schedule or attribution over rows you prepared.

Import it with: import { GanttChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.

Chosen configuration: `height={300}`, `state="ready"`, `ariaLabel="Delivery schedule"`.

Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.

Reproduce this state:
```tsx
<GanttChart
  tasks={[
    { id: "t1", name: "Scope", start: 1791158400000, end: 1791504000000, progress: 1 },
    { id: "t2", name: "Build", start: 1791504000000, end: 1792368000000, progress: 0.7 },
    { id: "t3", name: "Review", start: 1792195200000, end: 1792713600000, progress: 0.2 },
    { id: "t4", name: "Release", start: 1792800000000, end: 1792972800000 },
  ]}
  axisLabel="Weeks"
  timeFormat={{ kind: "date" }}
  height={300}
  ariaLabel="Delivery schedule"
  state="ready"
/>
```

Usage

The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.

It is drawn by the ECharts engine.

Worked examples with real data are on the family overview: Workflow & operations

import { GanttChart } from "@luc/ui/charts";
<GanttChart
  tasks={[
    { id: "t1", name: "Scope", start: 1791158400000, end: 1791504000000, progress: 1 },
    { id: "t2", name: "Build", start: 1791504000000, end: 1792368000000, progress: 0.7 },
    { id: "t3", name: "Review", start: 1792195200000, end: 1792713600000, progress: 0.2 },
    { id: "t4", name: "Release", start: 1792800000000, end: 1792972800000 },
  ]}
  axisLabel="Weeks"
  timeFormat={{ kind: "date" }}
  height={300}
  ariaLabel="Delivery schedule"
/>

Data contract

`tasks` contain id/name, numeric `start` and `end` timestamps, and optional `progress` from 0 to 1. The chart does not schedule or infer dependencies.

Important configuration

Use `axisLabel` and `timeFormat` for the calendar context, keep task order stable, and show progress only when it is a real measured state.

Guidelines

When not to use

Do not use a Gantt chart for milestones with no duration or for dependencies the data does not contain.

Configuration

Exported symbols
ExportKindSignature
GanttChart13 documented props({ tasks, timeFormat, axisLabel, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: GanttChartProps) => import("@types/react").JSX.Element

GanttChart props

Type: GanttChartProps

Values the compiler reads from the declaration.

GanttChart props
PropTypeDefaultNotes
ariaDescription?string | undefined—
ariaLabel?string | undefined—
axisLabel?string | undefined—Name the axis, e.g. "Scheduled" or "Actual".
className?string | undefined—
description?string | undefined—
eager?boolean | undefined—Create the engine on mount rather than when the surface is approached.
height?string | number | undefined—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
state?ChartState | undefined—
tasksreadonly GanttTask[]—
timeFormat?ChartFormat | undefined—Time-axis format for the header labels.
title?string | undefined—

Accessibility

A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.

What happens on the server, and when hydration changes it.

Family

Workflow & operations

Sequence, schedule, comparison and attribution.

Luc UI v1.0GanttChartdark theme