Controls

Gantt Chart

Effect
Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Gantt Chart

Today's plan
TaskStartEndProgress
Research8am9amDone
Design8am10amDone
Design12pm2pm30%
Build10am12pm77%
Build2pm4pm76%
Review1pm2pmDone
Launch3pm7pm81%

Gantt Chart

Rounded timeline bars that fill with each task's progress and tick when done.

Installation

npx shadcn@latest add ikislay/pixel-ui/gantt-chart

How to use

import { 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} />
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
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*
string

Names the chart for screen readers and captions its data table.

formatTime
(value: number) => string

Formats the times along the top and in the tooltip, such as hours into 2 PM.

rowHeight
number

Height of each row in pixels.

className
string

Merged onto the root element.