Create

General

Gantt

Experimental
Copy page View as Markdown Open in ChatGPT Open in Claude

A project timeline from hours to years with a tree of rows, task bars you can drag and resize, progress, baselines, dependencies and recurring tasks.

Usage#

app.component.ts
import { WdsGanttComponent } from '@wds/angular/gantt';

Examples#

Default#

resources (the rows) and events (the tasks) are properties. A resource with children is a collapsible group with a summary bar of its tasks; a task has start and end as ISO dates (end is inclusive), an optional progress and a color. Drag a bar to move it or its edges to resize it; the chart updates events and fires wds-event-change. The timeline scrolls without end and renders only what is visible; the arrows at the edge of a row jump to tasks out of view, and + / − zoom. off-days hatches weekends.

Product roadmap#

scale sets the period: day, week, month, quarter (here, with weeks in the header) or year; the scale menu in the bar changes it too. The toolbar slot adds items to the navigation bar: here a button that schedules the next initiative in the backlog row.

Add to roadmap

Team capacity#

Overlapping tasks in one row stack in extra lanes. renderResourceLabel returns the row label as text or a DOM node (here an avatar with initials; it renders in shadow DOM, so style it inline). With drag-create, drawing a range on an empty part of a row fires wds-slot-select with the row and the dates; here it adds an assignment.

Status report#

columns adds columns to the tree panel after the name; a column reads resource[key] or returns text or a DOM node from render (here a wds-badge). readonly turns off moving, resizing and deleting (a task can also have readOnly). A task with milestone is a diamond. --wds-gantt-tree-width widens the tree panel.

Baseline#

baselineStart and baselineEnd draw the planned window as an outline behind the actual bar; on a group resource they outline the plan of the whole group. A bar gets data-baseline-variance (early, late or on-time), and the variance is part of its accessible name. hide-baseline hides the plans.

Dependencies and milestones#

dependencies lists the ids of the predecessors of a task: the chart draws a finish-to-start arrow from each of them (hide-dependencies hides the arrows). canDropEvent validates a move or resize before it is applied: here a task cannot start before its predecessors end or end after its successors start.

Day schedule and time zones#

Date-times put a task at a time of day: with a zone (2026-10-01T06:00:00Z) they are instants shown in time-zone, without one (2026-10-01T09:00) they are wall-clock times. The day scale shows hours and moves tasks in steps of snap minutes. Change the zone to see the same shifts in another time zone; after a move the chart writes dates back in the form they came in.

UTCEurope/WarsawAmerica/New_YorkAsia/Tokyo

Recurring tasks#

recurrence repeats a task: a rule object ({ freq: 'weekly', interval: 2 }) or an RRULE string (FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR) with INTERVAL, COUNT, UNTIL, BYDAY, EXDATE and RDATE. Occurrences are expanded for the visible range; moving one moves the whole series. parseRRule, formatRRule and expandRecurrence are exported too.

Selection, menus and moving rows#

selectable adds a checkbox to every row that selects its tasks (Ctrl or ⌘ and a click adds a single task) and fires wds-selection-change. Delete or Backspace deletes the selected tasks (wds-event-remove). eventActions adds a context menu to the bars (right click or Shift+F10) and resourceActions a menu to the rows; the chosen item comes in wds-event-action or wds-resource-action. reorderable lets rows be moved with the handle or Alt+↑/↓ (wds-resource-reorder).

Selected tasks: 0

Settings#

Every part of the view can be turned off: hide-today, hide-summary, hide-dependencies, hide-baseline, hide-indicators, hide-zoom and hide-nav; bar-label places the titles inside or after the bars. Here a wds-dropdown in the toolbar switches them.

Settings DisplayOff daysToday lineSummary barsDependenciesBaselinesOff-screen indicatorsZoom controlDrag and resizeBar labelsAutoInsideOutside

API References#

wds-gantt#

A Gantt chart: a tree of rows (resources) next to a timeline with task bars (events), from a day with hours to a year with months. Bars can be moved and resized with the pointer or the keyboard; a group row shows a summary bar of its tasks. Tasks can have progress, a planned window (baseline), dependencies drawn as arrows, a repeat rule, and a milestone shows as a diamond. The timeline scrolls without end (within min/max) and renders only the visible rows and dates.

Attributes

AttributeTypeDefaultDescription
scaleWdsGanttScale'month'Time scale: the period shown at once.
datestring''A date in the period shown (ISO). Empty: today. Updated while scrolling.
zoomnumber1Width multiplier of the timeline (0.25–4); the zoom control changes it by 25%.
selectedstring[]Ids of the selected tasks. In HTML a space-separated list.
collapsedstring[]Ids of the collapsed groups (a resource with collapsed: true starts here). In HTML a space-separated list.
readonlybooleanfalseTasks cannot be moved, resized or deleted (selection still works).
drag-create.dragCreatebooleanfalseDrawing a range on an empty part of a row fires wds-slot-select (such as to add a task there).
selectablebooleanfalseA checkbox in every row selects all its tasks (and the header one all tasks).
reorderablebooleanfalseRows can be moved with a drag handle or Alt+↑/↓ (fires wds-resource-reorder).
off-days.offDaysbooleanfalseShades weekends (Saturday and Sunday) and holidays.
holidaysstring[][]Extra days off (ISO dates), shaded with off-days. In HTML a space-separated list.
time-zone.timeZonestring''IANA time zone the chart shows times in (such as Europe/Warsaw). Default: the browser's.
snapnumber15Step of moves and resizes on the day scale, in minutes (other scales move by whole days).
minstring''First date the timeline reaches (ISO).
maxstring''Last date the timeline reaches (ISO).
bar-label.barLabelWdsGanttBarLabel'auto'Where a bar shows its title: inside, after the bar, or inside when it fits (auto).
hide-nav.hideNavbooleanfalseHides the navigation bar (navigate with next(), prev(), today() and goTo()).
hide-today.hideTodaybooleanfalseHides the line of the current time and the shading of today.
hide-summary.hideSummarybooleanfalseHides the summary bars of group rows.
hide-dependencies.hideDependenciesbooleanfalseHides the dependency arrows.
hide-baseline.hideBaselinebooleanfalseHides the planned windows (baselines).
hide-zoom.hideZoombooleanfalseHides the zoom control.
hide-indicators.hideIndicatorsbooleanfalseHides the indicators of tasks before and after the visible part of a row.
loadingbooleanfalseShows a spinner in the navigation bar and sets aria-busy (such as while tasks load).
name-header.nameHeaderstring'Resources'Header of the name column.
empty-text.emptyTextstring'No tasks.'Text shown when there are no rows.
labelstring'Gantt chart'Accessible name of the chart.
localestring''Language of dates (such as en-US). Defaults to the nearest lang attribute.
first-day.firstDaynumber | undefinedFirst day of the week: 0 = Sunday, 1 = Monday. Defaults to the language.

Properties

PropertyDescription
resourcesWdsGanttResource[]Rows of the tree panel (WdsGanttResource[]); a row with children is a collapsible group. The chart updates it after a row is moved.
eventsWdsGanttEvent[]Tasks (WdsGanttEvent[]). The chart updates this array itself after a move, resize or delete.
columnsWdsGanttColumn[]Extra columns of the tree panel, after the name (WdsGanttColumn[]).
eventActionsWdsGanttAction[]Items of the task context menu (right click, Shift+F10 or the Menu key), see wds-event-action.
resourceActionsWdsGanttAction[]Items of the row menu (a button at the end of the row, Shift+F10 on the row), see wds-resource-action.
renderEvent(event: WdsGanttEvent) => string | Node | undefinedCustom bar content (text or a DOM node, styled inline or a wds-* element) instead of the title.
renderResourceLabel(resource: WdsGanttResource) => string | Node | undefinedCustom row label (text or a DOM node, such as an avatar and a name) instead of the title.
canDropEvent(change: Omit<WdsGanttEventChangeDetail, 'events'>) => boolean | undefinedValidates a move or resize before it is applied: return false to reject it.
canSelectSlot(slot: WdsGanttSlotSelectDetail) => boolean | undefinedValidates a range drawn with drag-create: return false to reject it (the preview turns red).
canReorderResource(reorder: Omit<WdsGanttResourceReorderDetail, 'resources'>) => boolean | undefinedValidates a row move: return false to reject it.

Events

EventDescription
wds-zoom-changeCustomEvent<WdsGanttZoomChangeDetail>The zoom changed with the zoom control.
wds-range-changeCustomEvent<WdsGanttRangeChangeDetail>The period changed (navigation, scale or scrolling).
wds-selection-changeCustomEvent<WdsGanttSelectionChangeDetail>The selected tasks changed.
wds-event-changeCustomEvent<WdsGanttEventChangeDetail>A task was moved or resized (after canDropEvent accepted it).
wds-event-removeCustomEvent<WdsGanttEventRemoveDetail>Tasks were deleted with Delete or Backspace.
wds-collapse-changeCustomEvent<WdsGanttCollapseChangeDetail>A group was collapsed or expanded.
wds-slot-selectCustomEvent<WdsGanttSlotSelectDetail>A range was drawn on an empty part of a row (drag-create).
wds-resource-reorderCustomEvent<WdsGanttResourceReorderDetail>A row was moved (reorderable).
wds-resource-actionCustomEvent<WdsGanttResourceActionDetail>An item of the row menu (resourceActions) was chosen.
wds-event-actionCustomEvent<WdsGanttEventActionDetail>An item of the task context menu (eventActions) was chosen.

Methods

MethodDescription
next()Shows the next period.
prev()Shows the previous period.
today()Shows the period with today.
goTo(date: string)Shows the period with the given date (ISO).
scrollToEvent(id: string)Scrolls to a task (its first occurrence) and expands its groups.
zoomIn()Makes the timeline 25% wider.
zoomOut()Makes the timeline 25% narrower.

Slots

SlotDescription
toolbarExtra items at the end of the navigation bar (such as an “Add task” button).
emptyContent shown when there are no rows (instead of empty-text).

CSS parts (::part)

PartDescription
navThe navigation bar.
titleThe period title in the navigation bar.
scrollerThe scrolling area with the tree panel and the timeline.
treeThe tree panel (role="treegrid").
timelineThe timeline body with the bars.
zoomThe zoom control.

CSS custom properties

PropertyDescription
--wds-gantt-tree-widthWidth of the tree panel (default 15rem, 9rem in a narrow chart).
--wds-gantt-barDefault bar color (default --wds-chart-2).
--wds-gantt-nowColor of the current time line (default --wds-destructive).

Accessibility#

Screen reader#

The chart is a region named by label. The tree panel is a treegrid: a header row with columnheader cells and a row per resource with aria-level, aria-posinset, aria-setsize, aria-rowindex (rows outside the view are not rendered) and, on a group, aria-expanded. The header with dates is hidden from screen readers, because every bar names its dates.

The bars are in a group named “timeline”. A bar is a button (aria-pressed when it is selected, aria-haspopup with eventActions) named by its title, dates (with times on date-time tasks), progress, “repeats” for an occurrence and the variance against the plan, such as “Data migration, Sep 28 – Oct 3, 2026, 70% complete, late against the plan”. A milestone is named “milestone” with its date. A group summary bar is an image named by the group, its dates and progress. Dependency arrows and plan outlines are decorative.

An editable bar is described by the keyboard instructions. Moves, deletes and row moves made with the keyboard are announced in a live region, and so is a change rejected by canDropEvent or canReorderResource. The period title in the navigation bar is a live region and loading sets aria-busy.

The checkboxes, the row menu buttons and the indicators of tasks out of view are not in the tab order: rows and bars have their own keys for them. The built-in texts (Today, Scale, Previous period, Next period, Zoom in, Zoom out, “Select tasks of …”, “Actions for …”) are in English for now; label, name-header and empty-text can be changed.

Keyboard support#

KeyFunction
TabMoves focus to the navigation bar, the rows of the tree panel (one tab stop), the task bars (one tab stop) and the zoom control.
ArrowDownArrowUpOn a row: the next or previous row. On a bar: the next or previous task (row by row, from the earliest in a row).
ArrowRightArrowLeftOn a group row: expands it (or moves to its first row) and collapses it (or moves to the parent). On a bar: the next or previous task. Reversed in right-to-left layouts.
HomeEndThe first or last row, or the first or last task.
EnterOn a group row: expands or collapses it. On a bar: selects the task (Ctrl or ⌘ + Enter adds it to the selection).
SpaceOn a row with selectable: selects or clears its tasks (on the header row: all tasks). On a bar: selects the task.
Shift + ArrowLeftShift + ArrowRightMoves the focused task one step earlier or later (a day, or snap minutes on the day scale).
Alt + ArrowLeftAlt + ArrowRightMoves the end of the focused task one step earlier or later (a milestone has no end to move).
Alt + ArrowUpAlt + ArrowDownWith reorderable: moves the focused row up or down among its siblings.
DeleteBackspaceDeletes the selected tasks (or the focused one), unless the chart or the task is read-only.
Shift + F10ContextMenuOpens the menu of the focused task (eventActions) or row (resourceActions).
EscapeCancels a drag in progress, or clears the selection.
Footer