Svelte Gantt Chart

A Gantt chart is a data grid that draws its rows as bars on a time axis. SvGrid treats it exactly that way: same <SvGrid>, same data, same columns, one extra gantt prop. A parent field nests the rows into phases that draw a rolled-up bar, a dependency list draws the arrows between them, and the task table beside the chart is the grid itself, so search, sort and filter apply before a bar is drawn.

Dragging a bar does not mutate anything behind your back. The chart raises onTaskMove with the task and its new dates, pushes its successors forward through onDependenciesChange, and you write the rows. The planning layer is the part a table cannot fake: the critical path ringed in red with a slack column in working days, baseline ghosts where the plan drifted, constraints the cascade stops at, and a resource load strip that turns red past capacity.

Turn it on: gantt={{ startField: 'start', endField: 'end' }}

Install

npm i @svgrid/grid @svgrid/enterprise

The grid and its data model are MIT-licensed in @svgrid/grid; this view ships in the commercial @svgrid/enterprise package and runs unlicensed while you evaluate.

The code

<script lang="ts">
  import { SvGrid } from '@svgrid/grid'
  import { enableGanttView } from '@svgrid/enterprise'

  enableGanttView()

  let data = $state([
    { id: 'p1', name: 'Discovery', parentId: null, start: '2026-09-07' },
    { id: 't1', name: 'Interviews', parentId: 'p1', start: '2026-09-07', end: '2026-09-11', progress: 100 },
    { id: 't2', name: 'Synthesis', parentId: 'p1', start: '2026-09-14', end: '2026-09-18', progress: 40 },
  ])
  const columns = [
    { field: 'name', header: 'Task' },
    { field: 'start', header: 'Start' },
    { field: 'end', header: 'Finish' },
  ]
</script>

<SvGrid {data} {columns} getRowId={(r) => r.id}
  gantt={{
    startField: 'start', endField: 'end', parentField: 'parentId', progressField: 'progress',
    dependencies: [{ id: 'd1', from: 't1', to: 't2' }],
  }} />

What you get

Live examples

Documentation

Related articles

Frequently asked questions

How do I build a Gantt chart in Svelte 5?

Give <SvGrid> your rows and columns and set the gantt prop with the field holding each task's start, for example gantt={{ startField: 'start', endField: 'end' }}. Add parentField for phases and a dependencies list for arrows. The renderer is registered once with enableGanttView() from @svgrid/enterprise.

Is the Gantt chart free?

The grid, the gantt prop and its config types are MIT-licensed in @svgrid/grid. The Gantt renderer ships in the commercial @svgrid/enterprise package, which runs unlicensed with a small watermark while you evaluate it. The free recipe on this page, a timeline drawn in one custom cell, needs no license.

Does it have a critical path, baselines and dependencies?

Yes. criticalPath rings the chain with no slack and fills a slack column in working days; baselineStartField and baselineEndField draw the agreed dates as ghost bars; dependencies draws finish-to-start, start-to-start, finish-to-finish and start-to-finish links with lag, and a moved task cascades its successors.

Can I switch between the Gantt and a table?

Yes, and that is the point of the design. The Gantt is a view of the same grid, so toggling the gantt prop on and off swaps between bars and rows with no data changes. The same rows can also feed the scheduler for a resource timeline and the board prop for a Kanban.

Build something else

Get started · Browse the gallery · Pricing