Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Pro (paid add-on)

Gantt

Pro

Gantt is a project timeline with task groups, progress, dependencies and milestones, and bars you can move and resize with the mouse or the keyboard.

Part of Pro

This page documents part of @vjdesigns-pro/ui, the paid add-on package. Using it needs a Pro license and @vjdesigns/vjdesigns-ui 3.8.0 or later. Like the free package, it works in both modes, every brand, all 32 languages and right to left. Install it as described in Account forms.

Example

A project timeline: a season plan, a facilities project, a recruiting calendar. Tasks are plain data: start and end dates (inclusive), an optional progress (0 to 100), a parent to group tasks, dependencies (ids that must finish first), milestone and a color.

tsx
import { Gantt, type GanttTask } from "@vjdesigns-pro/ui";

const [tasks, setTasks] = useState<GanttTask[]>([
  { id: "pre", title: "Preseason", start: "2026-10-26", end: "2026-11-13" },
  { id: "try", parent: "pre", title: "Tryouts", start: "2026-10-26", end: "2026-10-30", progress: 100 },
  { id: "roster", parent: "pre", title: "Roster announced", start: "2026-11-02", end: "2026-11-02",
    milestone: true, dependencies: ["try"] },
]);

<Gantt
  aria-label="Season plan"
  tasks={tasks}
  onTaskSelect={openTask}
  onTaskChange={(task, dates) =>
    setTasks((list) => list.map((t) => (t.id === task.id ? { ...t, ...dates } : t)))
  }
/>;

Timeline and tasks

  • Groups span their tasks and average their progress; they collapse and expand.
  • Timeline: a day, week or month scale, a line for today with a button that scrolls to it, and arrows for dependencies. An arrow is dashed when a task starts before what it depends on has finished. The task list stays in view while the timeline scrolls.
  • Rescheduling: with onTaskChange, drag a bar to move it or either end to change its dates. From the keyboard, Alt with Left or Right moves a task a day, and Alt+Shift with Left or Right changes its end. Changes are announced.

Keyboard and languages

The chart is a treegrid and one Tab stop. Up and Down move between tasks, Left and Right collapse and expand groups, and Enter opens a task. Each row reads its title, dates, length, progress and dependencies. Dates and the first day of the week follow the locale, and the timeline runs right to left in right-to-left languages.

Props

Gantt

A project timeline: tasks as bars across days, weeks, or months, grouped under collapsible summary rows, with dependency arrows and a line for today. With onTaskChange, bars move by dragging and resize from either end, or from the keyboard.

Accessibility: a treegrid of tasks, one Tab stop. Up / Down move between tasks, Left / Right collapse and expand groups (or go to a task's group), Enter opens a task, Alt with Left / Right moves it a day, and Alt+Shift with Left / Right changes its end. Each row reads its title, dates, length, progress, and dependencies; changes are announced.

tsx
<Gantt
  aria-label="Season plan"
  tasks={tasks}
  onTaskChange={(task, dates) => save({ ...task, ...dates })}
/>
Gantt props
PropTypeDefault
aria-labelRequired

Accessible name of the chart (e.g. "Season plan").

string—
tasksRequired

The tasks, in display order. Subtasks follow their group's order.

readonly GanttTask[]—
scale

The time scale (controlled).

"day""week""month"—
defaultScale

Initial scale when uncontrolled.

"day""week""month""day"
onScaleChange

Called when the user switches scales.

(scale: GanttScale) => void—
collapsed

Ids of collapsed groups (controlled).

string[]—
defaultCollapsed

Initially collapsed groups when uncontrolled.

string[][]
onCollapsedChange

Called when a group is collapsed or expanded.

(collapsed: string[]) => void—
onTaskChange

Turns on moving and resizing (drag, or Alt with the arrow keys). Called with the new dates; update tasks.

(task: GanttTask, dates: GanttTaskDates) => void—
onTaskSelect

Called when a task is clicked or opened with Enter.

(task: GanttTask) => void—
startDate

First day shown.

ISODatea week before the earliest task
endDate

Last day shown.

ISODatethree weeks after the latest task
weekStartsOn

First day of the week, 0 (Sunday) to 6.

numberthe locale's
height

Height of the scrolling area (CSS length).

CSSProperties["maxHeight"]"32rem"
className

Class name for the root.

string—
style

Style for the root.

CSSProperties—

GanttTask

One task (or group of tasks) on the chart.

GanttTask props
PropTypeDefault
idRequired

Unique id.

string—
titleRequired

Name shown in the task list and read with the task.

string—
startRequired

First day, "YYYY-MM-DD". A task with subtasks spans them instead.

ISODate—
endRequired

Last day, "YYYY-MM-DD" (inclusive). A milestone's is its start.

ISODate—
progress

Percent done, 0 to 100. Groups average their subtasks by length.

number—
parent

The id of the group this task belongs to.

string—
dependencies

Ids of tasks that must finish first. Drawn as arrows.

readonly string[]—
milestone

A single moment rather than a span: drawn as a diamond.

boolean—
color

Palette slot 1 to 8 for the bar (a team, a phase).

number1
editable

Allow moving and resizing (when the chart has onTaskChange).

booleantrue

GanttTaskDates

New dates for a task.

GanttTaskDates props
PropTypeDefault
startRequiredISODate—
endRequiredISODate—