Skip to content

Zoom & Timeline

One timeline column equals one step at the current scale.

Scale idLabelStepColumn width (px)
monthMonth1 month120
weekWeek1 week140
dayDay1 day48
2day2 Days2 days64
6hour6 Hours6 hours56
3hour3 Hours3 hours48
1hour1 Hour1 hour40
hourHour1 hour64
minuteMinute1 minute40

Zoom props

PropDefaultDescription
zoomLevel'week'Current scale (controlled)
availableZoomLevelsmonth → week → day → hour → minuteToolbar steps
columnWidthpresetOverride column width (px)
tsx
const [zoom, setZoom] = useState('week');

<GanttChart
  zoomLevel={zoom}
  availableZoomLevels={['day', '2day', '6hour', '3hour', '1hour']}
  onZoomChange={(e) => setZoom(e.scaleId)}
/>

Fixed timeline range

Set both minDate and maxDate to lock the grid:

  • Grid does not grow when tasks are dragged outside
  • Task dates clamp to the window on drag/resize
  • Full range renders up front
tsx
<GanttChart
  tasks={tasks}
  minDate="2026-01-01"
  maxDate="2026-06-30"
  zoomLevel="week"
/>

Without both bounds, the range auto-expands from task min/max plus paddingUnits (default 2 columns each side).

Large timelines

For 50+ rows and multi-year ranges, column virtualization keeps scroll performance smooth.

See Grid Snap and Large Timeline examples.

Released under the MIT License.