Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| Task | Start | End | Progress |
|---|---|---|---|
| Research | 8am | 9am | Done |
| Design | 8am | 10am | Done |
| Design | 12pm | 2pm | 30% |
| Build | 10am | 12pm | 77% |
| Build | 2pm | 4pm | 76% |
| Review | 1pm | 2pm | Done |
| Launch | 3pm | 7pm | 81% |
Rounded timeline bars that fill with each task's progress and tick when done.
npx shadcn@latest add ikislay/pixel-ui/gantt-chartimport { GanttChart } from "@/components/ui/gantt-chart"const tasks = [{ label: "Research", start: 8, end: 10.5, progress: 1 },{ label: "Design", start: 9.5, end: 13, progress: 0.6 },{ label: "Build", start: 12, end: 17, progress: 0.25 },]const hour = (h: number) => (h % 12 || 12) + (h < 12 ? " AM" : " PM")export function Demo() {return <GanttChart label="Today's plan" tasks={tasks} formatTime={hour} />}
1// Loading…
Options you can pass to customize this component.
tasks*{ label: string; start: number; end: number; progress?: number; color?: string }[]Bars on the timeline. Progress runs from 0 to 1. Tasks with the same label share a row and a color.
label*stringNames the chart for screen readers and captions its data table.
formatTime(value: number) => stringFormats the times along the top and in the tooltip, such as hours into 2 PM.
rowHeightnumberHeight of each row in pixels.
classNamestringMerged onto the root element.