Gantt

import { Gantt } from '@hanzo/ui'

Default

Four tasks, each a labelled progress bar between its start and end date.

Project Planning100%
1/1/20241/15/2024
Design Phase75%
1/10/20242/5/2024
Development45%
2/1/20244/30/2024
Testing0%
4/15/20245/15/2024
export function Default() {
return (
<YStack width="100%" maxW={720}>
<Gantt tasks={project} />
</YStack>
)
}

Empty

With no tasks the card shows a placeholder instead of an empty list.

No tasks available. Add tasks to display Gantt chart.
export function Empty() {
return (
<YStack width="100%" maxW={720}>
<Gantt tasks={[]} />
</YStack>
)
}

Single task in progress

One row, midway through, so the fill sits at half width.

Migrate database50%
6/1/20246/10/2024
export function InProgress() {
return (
<YStack width="100%" maxW={720}>
<Gantt tasks={[ { id: '1', name: 'Migrate database', start: new Date(2024, 5, 1), end: new Date(2024, 5, 10), progress: 50 }, ]} />
</YStack>
)
}

Types

export interface GanttTask {
id: string
name: string
start: Date
end: Date
/** 0–100. Defaults to 0. */
progress?: number
}
export type GanttProps = ComponentProps<typeof Frame> & {
tasks?: GanttTask[]
}

Exports

Gantttype GanttPropstype GanttTask