Skip to content
WunderUI

Timeline Chart

Pro

Timeline chart: a Gantt chart with milestones and a Today line, and an event timeline.

Playground

Launch plan

Launch plan: 7 tasks from W40 to W56, today W49.
Launch plan, data table
labelStartEndGroup
DiscoveryW40W43Product
DesignW42W46Design
APIW44W50Engineering
Web appW46W52Engineering
Mobile appW48W53Engineering
QAW51W54Quality
LaunchW54W54Product

Installation

Timeline Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.

The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.

Then import what you need:

tsx
import {
  TimelineChart,
  TimelineChartProps,
  TimelineChartVariant,
} from "@wunderui/react/charts"

Then use it:

tsx
import { TimelineChart } from "@wunderui/react/charts"

const items = [
  { label: "Design", start: 42, end: 46 },
  { label: "API", start: 44, end: 50 },
  { label: "Launch", start: 54, end: 54 },
]

export function LaunchPlan() {
  return <TimelineChart items={items} timeFormatter={(w) => `W${Math.round(w)}`} label="Launch plan" />
}

Expected result: Two bars on a week scale and a diamond for the launch, with the task names at the left.

When to use

Use Timeline Chart for

  • A plan with tasks, durations and milestones (Gantt)
  • Events along a time axis, above and below it
  • A Today line against a plan

Use something else for

States

Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.

Launch plan

Launch plan: 7 tasks from W40 to W56, today W49.
Launch plan, data table
labelStartEndGroup
DiscoveryW40W43Product
DesignW42W46Design
APIW44W50Engineering
Web appW46W52Engineering
Mobile appW48W53Engineering
QAW51W54Quality
LaunchW54W54Product

Keyboard interactions

The plot is focusable. Arrow keys walk the items and the live region reads a task as Design: 2 to 6, group Design, and the data table has Start and End (or Date) and a Group column.

TaborShiftTab
Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge.
ArrowRightorArrowLeft
Moves to the next or previous item. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one).
HomeorEnd
Jumps to the first or last item.
Escape
Clears the active point.
EnterorSpace
On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on.

Behavior and motion

What the chart does on its own and what the page decides.

Items
Each item has a label and either a start and end (a Gantt bar) or a time (an event), plus an optional caption and group. An item whose start equals its end is a diamond milestone.
Scale
Positions are numbers on a round scale across the range of the items, or a fixed range, formatted by your formatter. Today draws a labelled Today line.
Events
In the event timeline, events sit on stems above and below the axis, alternating, so their labels don't collide.
Bad times
Items without valid times are skipped before the chart decides whether it is empty.
Loading, empty and error
The chart keeps its size while it loads, is empty or fails, so the card never jumps. Loading shows a muted shimmer, and an error shows a Try again button when you add a retry handler.
Legend
A ChartCard shows the series as badges. With two or more series each badge switches its series off and the last visible one stays on, and a legend of roles instead of series can be made static.
Size
The chart fills the width of its container, and you set the plot height. Text never scales, so labels keep their size at every width.

Motion

The enter sequence and the hover follow the library's motion tokens.

Grow
Bars grow from their start the first time the chart is in view, and again after loading, on a key change or when new items arrive. You can turn it off.
Reduced motion
With reduced motion the enter sequence is off and the chart appears at once. The tooltip, crosshair and every state still work.

Anatomy

TimelineChart plots items on a numeric time scale: a Gantt chart of task bars and milestones, or an event timeline above and below an axis. Positions are numbers such as days, weeks or timestamps.

Launch plan

Launch plan: 6 tasks from W40 to W56, today W49.
Launch plan, data table
labelStartEndGroup
DiscoveryW40W43Product
DesignW42W46Design
APIW44W50Engineering
Web appW46W52Engineering
QAW51W54Quality
LaunchW54W54Product
  • Takes the items (label, start and end for Gantt, a time for events, plus an optional caption and group), groups for colours and legend, a Today marker, a fixed range and a label formatter.

  • data-slot="chart-plot"

    The focusable region. Arrow keys walk its marks and the live region reads each one the way the tooltip shows it.

  • data-slot="chart-marks"

    Bars that grow from their start, and an item whose start equals its end becomes a diamond milestone. Events sit on stems above and below the axis, alternating.

  • Ticks on a round scale across the range of the items (or a fixed range), formatted by your label formatter, plus a Today line when set.

  • Optional

    On Gantt, the task names in a column at the left, as wide as the longest name.

  • data-slot="chart-tooltip"Optional

    The label with its time range (or the event time) and its group.

  • data-slot="chart-message"Optional

    Muted bars under the shimmer. Items without valid times are skipped before the chart decides whether it is empty.

  • A table of the items and their times for screen readers.

Best practices

  • Do

    Use one numeric scale and a formatter that makes it readable, such as week numbers, month names or dates. The axis labels are the only date context.

  • Do

    Set Today on planning charts so progress reads against the present, and group tasks by team.

  • Do

    Keep Gantt to about 15 rows per chart. Past that, split by team or phase so each 44 px row stays readable.

  • Don’t

    Don't draw dependencies the chart doesn't know. Arrows between tasks aren't part of it, so mention a blocking task in the label.

  • Don’t

    Don't use the event timeline for more than about ten events. Labels that alternate above and below will overlap.

API reference

One table for TimelineChart. It is a plain component, so the table lists every prop, and the ChartCard around it takes its own props and works without one.

Takes the items (label, start and end for Gantt, a time for events, plus an optional caption and group), groups for colours and legend, a Today marker, a fixed range and a label formatter.

PropTypeDefaultDescription
items requiredreadonly TimelineItem[]—
variant"gantt" | "event-timeline""gantt"Figma variant. Default .
groupsreadonly { key: string; label?: string; color?: ChartColor }[]—Groups in legend order with colours (team, kind of event).
todaynumber—A "Today" line on the scale.
todayLabelstring"Today"
domainreadonly [number, number]—Visible range (default: the items' range).
timeFormatter(v) => string—Formats a position on the time scale, e.g. (w) => or a date.
labelstring—
heightnumber—
state"ready" | "loading" | "empty" | "error"—
hiddenSeriesreadonly string[]—
activeIndexnumber | null—The active point (hovered or focused) as an index into , to control it yourself. shows none.
animateboolean—
animationKeystring | number—
defaultActiveIndexnumber | null—The point that is active at first, for an uncontrolled chart. It shows the tooltip without a pointer.
descriptionstring—
onActiveIndexChange(index) => void—Called with the index when the pointer or the arrow keys move to another point, and with when they leave. Use it to show the hovered value in a headline.
onRetry() => void—Shows a Try again button in the error state and calls this when it is pressed.
widthnumber—

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("timeline-chart")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.