# Gantt Chart

A project schedule you can drag: bars follow the pointer and push their dependents along, progress scrubs inside each bar, dependencies are drawn from one task to another, and zoom springs the whole grid.

- Page and source: https://uibrik.com/components/gantt-chart
- Install (Pro, needs a license key, see https://uibrik.com/docs/pro): `npx shadcn@latest add @uibrik-pro/gantt-chart`
- Packages: none beyond React
- Import: `import { GanttChart } from "@/components/uibrik/gantt-chart/gantt-chart"`

Where to use the Gantt Chart React component:

- **Project and roadmap planning**: Dragging one task pushes everything that waits on it, so the knock-on effect of a slip is visible straight away. Pairs with [Kanban Board](https://uibrik.com/components/kanban-board).
- **Agency and client schedules**: Drag from one task to another to link them, and hover a task to light up its whole chain. Pairs with [Issue Tracker](https://uibrik.com/components/issue-tracker).
- **Launch plans in dashboards**: Progress fills each bar and a today line shows what should be done by now. Pairs with [Project Dashboard](https://uibrik.com/components/project-dashboard).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| cascade | `boolean` | `true` | Moving a task pushes every task that depends on it. |
| showDependencies | `boolean` | `true` | Draw an arrow from each task to the tasks that wait on it. |
| showWeekends | `boolean` | `true` | Shade Saturdays and Sundays. |
| editable | `boolean` | `true` | Let bars be dragged, resized, scrubbed, linked and moved with the arrow keys. |
| dayWidth | `number` | `40` | Starting width of one day. The + and − buttons zoom from there. |
| days | `number` | `35` | Days on the grid. |
| color | `string` | `"#4f8cf0"` | Colour for tasks without their own `color`, and for focus rings. |
| tasks | `GanttTask[]` |  | Tasks (controlled). Pair with onTasksChange. |
| GanttTask | `{ id: string; name: string; start: string; duration: number; progress?: number; dependsOn?: string[]; assignee?: string; color?: string }` |  | `start` is "YYYY-MM-DD"; `duration` in days, 0 for a milestone; `progress` from 0 to 1; `color` tints the bar, e.g. one per workstream. |
| defaultTasks | `GanttTask[]` | `SAMPLE_TASKS` | Tasks on mount (uncontrolled). |
| onTasksChange | `(tasks: GanttTask[]) => void` |  | Called with every task after a drag, resize, progress change, new or removed dependency, or arrow key, including tasks pushed along. |
| avatars | `Record<string, string>` | `SAMPLE_AVATARS` | Photo URL for each assignee name. Assignees without one show their initials. |
| from | `string` |  | First day on the grid. Defaults to the Monday before the earliest task. |
| today | `string` |  | Day of the today line. Defaults to the visitor's today, set after mount. |
| locale | `string` | `"en-US"` | Locale for month and day labels. |
| className | `string` |  | Classes for the card. |
