Options

Configuration Structure

Options: {
theme: ThemeMode,
locale: LocaleOptions,
direction: TextDirection,
dateLocale: GanttDateLocale,
name: string,
weekdays: string[],
weekdaysShort: string[],
weekdaysMin: string[],
months: string[],
monthsShort: string[],
weekStart: number,
yearStart: number,
formats: Partial<Record<string, string>>,
relativeTime: Partial<Record<string, string>>,
meridiem: Function,
ordinal: Function,
messages: { ... },
addTask: string,
deleteSelected: string,
undo: string,
redo: string,
exportAsSvg: string,
exportAsPng: string,
exportAsPdf: string,
filterButton: string,
filterHeading: string,
filterMatchLabel: string,
filterMatchAll: string,
filterMatchAny: string,
filterAddCondition: string,
filterApply: string,
filterClear: string,
filterNoConditions: string,
filterOperatorLabel: Function,
groupNone: string,
groupCountLabel: Function,
exportFailedNoChart: string,
exportFailedGeneric: string,
editTask: string,
addChildTask: string,
addSiblingTask: string,
indent: string,
outdent: string,
deleteTask: string,
formTaskName: string,
formStartDate: string,
formEndDate: string,
formProgress: string,
formSubmit: string,
editTaskTitle: Function,
addTaskRowLabel: string,
baselineLabel: string,
startLabel: string,
endLabel: string,
summaryAriaLabel: Function,
barAriaLabel: Function,
barAriaValueText: Function,
progressAriaLabel: Function,
annotationBgColor: string,
annotationOrientation: Orientation,
annotations: Annotation[],
bgColor: string,
borderColor: string,
borderDashArray: number,
borderWidth: number,
label: AnnotationLabel,
fontColor: string,
fontFamily: string,
fontSize: string,
fontWeight: string,
orientation: Orientation,
text: string,
x1: string,
x2: null | string,
enableProjectBoundary: boolean,
arrowColor: string,
backgroundColor: string,
barBackgroundColor: string,
barBorderRadius: string,
barLabel: BarLabelOptions,
position: BarLabelPosition,
field: Task,
render: BarLabelRenderer,
className: string,
leadingPadding: number,
barMargin: number,
barTextColor: string,
summaryBarColor: string,
milestoneColor: string,
baseline: { ... },
enabled: boolean,
color: string,
striped: boolean,
stripeColor: string,
stripeWidth: number,
stripeAngle: number,
calendar: CalendarOptions,
workingWeekdays: number[],
holidays: ReadonlyArray<HolidayEntry>,
showNonWorkingStripes: boolean,
holidayTooltip: Function,
dragSnapMode: 'next' | 'previous' | 'allow',
dependencies: DependencyOptions,
cornerRadius: number,
hitWidth: number,
classBuilder: DependencyClassBuilder,
tooltipTemplate: DependencyTooltipTemplate,
editable: boolean,
borderColor: string,
canvasStyle: string,
criticalBarColor: string,
criticalArrowColor: string,
enableCriticalPath: boolean,
enableCrosshair: boolean,
crosshairColor: string,
crosshairLabelFormat: CrosshairLabelFormatter,
cellBorderColor: string,
cellBorderWidth: string,
columnConfig: ColumnListItem[],
key: ColumnKey | string,
title: string,
minWidth: string,
maxWidth: string,
flexGrow: number,
visible: boolean,
resizable: boolean,
render: ColumnRenderer,
accessor: Function,
sortable: boolean,
comparator: TaskComparator,
sortBy: Array,
key: ColumnKey | string,
direction: SortDirection,
filterBy: TaskFilterPredicate,
filterRules: FilterRuleSet,
match: 'all' | 'any',
rules: FilterRule[],
field: ColumnKey | string,
operator: FilterOperator,
value: string | number,
groupBy: GroupCriterion | ColumnKey | ...,
enableFilterBuilder: boolean,
columnLines: boolean,
enableRollups: boolean,
enableInlineEdit: boolean,
enableSelection: boolean,
enableExport: boolean,
exportFormat: GanttExportFormat,
persistState: boolean | GanttStatePersistenceOptions,
autoSizeColumns: boolean,
resizableColumns: boolean,
reorderableColumns: boolean,
enableResize: boolean,
enableTaskDrag: boolean,
enableTaskEdit: boolean,
enableTaskResize: boolean,
enableProgressDrag: boolean,
enableTaskCRUDToolbar: boolean,
enableContextMenu: boolean,
enableAddTaskRow: boolean,
enableDrawTask: boolean,
enableScrollButtons: boolean,
history: { ... },
enabled: boolean,
maxSize: number,
enableTooltip: boolean,
fontColor: string,
fontFamily: string,
fontSize: string,
fontWeight: string,
headerBackground: string,
height: number | string,
inputDateFormat: string,
rowBackgroundColors: string[],
rowHeight: number,
series: Array,
id: string,
name: string,
startTime: string,
endTime: string,
progress: number,
type: TaskType,
parentId: string,
dependency: string | TaskDependency,
barBackgroundColor: string,
rowBackgroundColor: string,
baseline: BaselineInput,
start: string,
end: string,
collapsed: boolean,
showSummaryBar: boolean,
assignees: Assignee[],
segments: TaskSegment[],
tasksContainerWidth: number,
tooltipBGColor: string,
tooltipBorderColor: string,
tooltipId: string,
tooltipTemplate: Function,
pixelsPerDay: number,
width: number | string,
parsing: ParsingConfig,
id: ParsingValue,
name: ParsingValue,
startTime: ParsingValue,
endTime: ParsingValue,
progress: ParsingValue,
type: ParsingValue,
parentId: ParsingValue,
dependency: ParsingValue,
barBackgroundColor: ParsingValue,
rowBackgroundColor: ParsingValue,
collapsed: ParsingValue,
showCheckboxColumn: boolean,
snapUnit: SnapUnit,
snapValue: number,
toolbarItems: ToolbarItem[],
enableQuickFilter: boolean,
quickFilter: QuickFilterOptions,
placeholder: string,
fields: ReadonlyArray<Task | string>,
caseSensitive: boolean,
taskListAriaLabel: string,
beforeTaskAdd: BeforeTaskAddHook,
beforeTaskUpdate: BeforeTaskUpdateHook,
beforeTaskMove: BeforeTaskMoveHook,
beforeTaskDelete: BeforeTaskDeleteHook,
beforeDependencyChange: BeforeDependencyChangeHook,
}

theme

Default: 'light'

Color theme preset.

Available Options:

  • light (default)
  • dark

width

Default: '100%'

Width of the chart. Accepts a pixel number or a CSS string.

height

Default: '500px'

Height of the chart. Accepts a pixel number or a CSS string.

canvasStyle

Default: 'border: 1px solid #CACED0; box-sizing: border-box'

Arbitrary CSS injected onto the root container element.

pixelsPerDay

Initial zoom level expressed as pixels per day. Continuous: the timeline header automatically picks calendar tiers (year, quarter, month, week, day, halfday, hour, minute) based on the current value. Bounds are clamped to roughly [0.25, 1280] px/day.

Reference values calibrated against the legacy presets:

  • Year ≈ 0.5
  • Quarter ≈ 1.6
  • Month ≈ 4.9
  • Week ≈ 25.7
  • Day = 80

When omitted, the chart auto-fits the full data range into the visible timeline area on first render. Supply an explicit value (or use the toolbar zoom controls) to take control.

backgroundColor

Default: '#FFFFFF'

Background color of the whole chart container.

headerBackground

Default: '#EBF3FB'

Background color of the timeline and task-list header row.

borderColor

Default: '#DFE0E1'

Color of the cell and row divider lines.

cellBorderColor

Default: '#D0D7DE'

Border color for all cells in the task table and timeline grid.

cellBorderWidth

Default: '1px'

CSS border-width for all cell lines.

columnLines

Default: true

Whether to draw vertical lines between timeline columns. Set to false for a cleaner aesthetic that keeps only the horizontal row dividers.

Available Options:

  • true (default)
  • false

inputDateFormat

Default: 'MM-DD-YYYY'

dayjs-compatible format string used to parse startTime / endTime values. Include time tokens (e.g. 'YYYY-MM-DD HH:mm') to enable sub-day scheduling; end-times are then treated as exclusive timestamps and inline editors switch to datetime-local inputs.

tasksContainerWidth

Default: 425

Initial pixel width of the task-list panel.

enableResize

Default: true

Allow the task-list panel to be resized by dragging the divider.

enableExport

Default: true

Show the export button in the toolbar. The format it produces is set by exportFormat.

exportFormat

Default: 'svg'

Format the toolbar export button produces. Any format is also available programmatically through gantt.exportChart(format).

Available Options:

  • svg (default): vector output
  • png: rasterized image
  • pdf: single-page, image-based, dependency-free

autoSizeColumns

Default: true

Size each task-list column to fit its header title and widest cell content, growing the task-list panel (never below tasksContainerWidth) so nothing is clipped. flexGrow still distributes any extra width, minWidth acts as a floor, and maxWidth (per column) as the ceiling. Set false to distribute the panel width purely by flexGrow.

Available Options:

  • true (default)
  • false

resizableColumns

Default: true

Allow task-list columns to be resized by dragging the handle at the trailing edge of a column header. A resized column is pinned to its chosen pixel width and the others absorb the remaining space. Double-click a handle to reset that column to auto width. Opt a single column out with columnConfig[].resizable: false.

Available Options:

  • true (default)
  • false

reorderableColumns

Default: true

Allow columns to be reordered by dragging a column header left or right onto another column. A vertical drop indicator shows the insertion point. The new order is captured by getState() / setState() and emitted as a columnReorder event.

Available Options:

  • true (default)
  • false

sortBy

Default: [{ key: 'startTime', direction: 'asc' }]

Initial sort applied to the task list, as one SortCriterion or an array of them. Sorting is hierarchy-preserving: siblings reorder within each parent and the tree is never flattened. With multiple criteria the first key wins and ties break on the next. Pass [] for natural (input) order. See the Sorting and Filtering guide.

sortBy: { key: ColumnKey.Name, direction: 'asc' }
sortBy: [{ key: ColumnKey.Progress, direction: 'desc' }, { key: ColumnKey.Name }]

key

Options.sortBy.key

Column to sort by. A ColumnKey value for built-in columns or a custom column id.

direction

Options.sortBy.direction

Sort direction for this criterion.

Available Options:

  • asc (default)
  • desc

filterBy

Default: undefined

Initial predicate filter run against each task. A task is kept when it matches or has a matching descendant, so ancestors of matches stay visible. View-only: it changes which rows render, never the tree, WBS, or task data.

filterBy: (task) => task.progress < 100

filterRules

Default: undefined

Initial structured filter for the advanced filter builder: a FilterRuleSet of conditions combined with 'all' (AND) or 'any' (OR). Takes precedence over filterBy when both are set.

filterRules: {
  match: 'all',
  rules: [{ field: 'progress', operator: 'lt', value: 100 }],
}

match

Options.filterRules.match

How the rules combine.

Available Options:

  • all: every rule must match (AND)
  • any: at least one rule must match (OR)

rules

Options.filterRules.rules

The conditions to evaluate. An empty list means no filter.

field

Options.filterRules.rules.field

Column key whose value is tested, either a ColumnKey or a custom column id.

operator

Options.filterRules.rules.operator

Comparison operator applied to the field value.

Available Options:

  • contains
  • notContains
  • equals
  • notEquals
  • startsWith
  • endsWith
  • gt
  • gte
  • lt
  • lte
  • before
  • after
  • on
  • isEmpty
  • notEmpty

value

Options.filterRules.rules.value

Operand compared against the field: a number for number columns, a YYYY-MM-DD string for date columns, free text otherwise. Ignored by isEmpty and notEmpty.

enableQuickFilter

Default: false

Show a quick-filter search box in the toolbar that matches task fields as the user types.

Available Options:

  • false (default)
  • true

quickFilter

Default: undefined

Fine-tune the quick filter. placeholder sets the input text (falls back to the localized quickFilterPlaceholder message), fields lists the task string fields matched (default ['name']), and caseSensitive controls case matching (default false).

quickFilter: { placeholder: 'Find a task', fields: ['name'], caseSensitive: false }

placeholder

Options.quickFilter.placeholder

Placeholder text for the search input. Falls back to the localized quickFilterPlaceholder message when omitted.

fields

Options.quickFilter.fields

Task string fields matched against the query.

caseSensitive

Options.quickFilter.caseSensitive

Match the query case-sensitively.

Available Options:

  • false (default)
  • true

enableFilterBuilder

Default: false

Show the advanced filter builder in the toolbar: a "Filter" button that opens a popover for composing field / operator / value conditions combined with All (AND) or Any (OR). Drives the same view-only filter as gantt.setFilterRules().

Available Options:

  • false (default)
  • true

groupBy

Default: undefined

Initial grouping applied to the task list, as a column key or a GroupCriterion. When set, the parent/child tree is suspended and every task appears flat under a collapsible group header. Clearing it restores the prior hierarchy. See the Row Grouping guide.

groupBy: ColumnKey.Progress
groupBy: { field: 'status', label: (v) => `Status: ${v}`, direction: 'desc' }

enableDrawTask

Default: false

Allow drawing a new task by dragging across empty timeline space. On release a task is created with the swept range snapped to snapUnit / snapValue. A preview bar follows the cursor, a plain click creates nothing, and Escape cancels mid-drag. Existing bars stay draggable and resizable. Creation runs through the beforeTaskAdd veto hook and is undoable.

Available Options:

  • false (default)
  • true

enableScrollButtons

Default: false

Show a chevron at the edge of any row whose bar is scrolled out of the visible timeline window; clicking it jumps the bar into view. Opt-in from 3.15.0 onward (previously true). gantt.scrollToTask() works regardless of this setting.

Available Options:

  • false (default)
  • true

scrollToTaskOnRowClick

Default: false

Clicking a task-list row scrolls that task's bar into view (nearest-edge, both horizontal and vertical), the same as calling gantt.scrollToTask(). Composes with enableSelection, so a single click both selects the row and reveals its bar. Clicks on the selection checkbox, the toggle chevron, and active inline-edit inputs are ignored.

Available Options:

  • false (default)
  • true

persistState

Default: false

Persist and restore the UI view state (zoom, scroll, sort, filter, collapse, selection, manual column widths, and column order) via localStorage. Pass true for the default key ('apexgantt-state'), or an object { key } to set a custom key. Restored on the first render() and saved (debounced) on every view change. The state is also available programmatically through gantt.getState() / gantt.setState(). See the Saving and Restoring State guide.

persistState: true
persistState: { key: 'project-42-gantt' }

arrowColor

Default: '#94A3B8'

Color of dependency arrows between tasks.

barBackgroundColor

Default: '#87B7FE'

Default background fill color for task bars. Theme-aware: a different default applies in the dark theme.

barBorderRadius

Default: '5px'

CSS border-radius applied to task bars.

barMargin

Default: 8

Top and bottom margin inside each row for the task bar in pixels.

barTextColor

Default: '#FFFFFF'

Text color rendered inside task bars.

summaryBarColor

Default: '#B9CECE'

Fill color for summary (group) bars. Renders distinct from regular task bars to make the parent/child hierarchy visually obvious. Theme-aware.

milestoneColor

Default: '#7C3AED'

Fill color for milestone diamonds. Theme-aware.

barLabel

Per-task bar label. By default the task name renders to the right of the bar so narrow bars don't clip their text. Set position: 'inside' to render centered inside the bar, 'auto' to pick automatically based on bar width, or supply render to compose names with chips, icons, or owner info.

barLabel: {
  position: 'auto',
  render: (task) => `<span>${task.name} · ${task.progress}%</span>`,
}

position

Options.barLabel.position
Default: 'right'

Where to render the label relative to the bar.

Available Options:

  • right (default): rendered immediately to the right of the bar; always visible regardless of bar width
  • inside: centered inside the bar; clipped when the bar is narrower than the text
  • left: rendered immediately to the left of the bar
  • auto: inside when the label fits, otherwise right

field

Options.barLabel.field
Default: 'name'

Task field whose value populates the label when render is not set.

render

Options.barLabel.render

Custom renderer for the bar label. Receives the resolved task and returns an HTML string (assigned via innerHTML, so escape user input yourself) or an HTMLElement. Returning null or undefined falls back to rendering barLabel.field.

className

Options.barLabel.className

Extra CSS class added to the label element.

leadingPadding

Options.barLabel.leadingPadding
Default: 0

Pixels of empty space added to the start of the timeline so left-side labels have room to render without being hidden behind the task-list panel. Auto-defaults to 120 when position is 'left', and 0 otherwise. Set explicitly to 0 to disable the padding.

rowBackgroundColors

Default: ['#FFFFFF']

Alternating row background colors. The pattern cycles automatically.

rowHeight

Default: 38

Height of each task row in pixels.

enableTaskDrag

Default: true

Allow tasks to be reordered by dragging rows in the task list.

enableTaskEdit

Default: false

Show the inline task-edit form when a task row is clicked.

enableInlineEdit

Default: false

Allow editing task fields directly in task-list cells. When true, double-clicking a name, startTime, endTime, duration, or progress cell swaps the cell for an input: commit with Enter or blur, cancel with Escape. Summary rows, milestones, and empty rows are not editable. Auto-enabled when enableTaskEdit is true unless explicitly set to false.

Available Options:

  • false (default)
  • true

enableTaskResize

Default: true

Allow task bars to be resized by dragging their handles.

enableProgressDrag

Default: true

Allow editing task progress by dragging the small handle at the bottom of the bar. The handle becomes visible on bar hover and snaps to whole percent on commit. Emits a taskProgressChanged event.

Available Options:

  • true (default)
  • false

enableTaskEditingShortcuts

Enable keyboard shortcuts for task editing when the task-list panel has focus: Delete / Backspace deletes the focused row (cascade 'children'), Tab / Shift+Tab indent / outdent in the tree. Off by default. See the Inline Editing guide.

enableTaskCRUDToolbar

Show built-in + Add Task, Delete, and Undo/Redo buttons in the toolbar. The delete button acts on the current selection, so pair it with enableSelection: true. Off by default.

enableContextMenu

Show a built-in right-click context menu on task bars and task-list rows (Edit, Add child / sibling, Indent, Outdent, Delete). Entries are gated by capability. Off by default.

enableAddTaskRow

Show a single-line + Add task row at the bottom of the task list that inserts a new root-level task on click. Disabled automatically once row virtualization kicks in (dataset >= 50 rows). Off by default.

snapUnit

Default: 'day'

Granularity at which task drag, resize, and inline edits snap. Affects data updates only: the timeline header tier follows pixelsPerDay independently. Use 'hour' or 'minute' together with snapValue for sub-day scheduling; end-times are treated as exclusive timestamps when inputDateFormat includes time tokens.

Available Options:

  • day (default)
  • hour
  • minute

snapValue

Default: 1

Multiplier applied to snapUnit. Examples: snapUnit: 'minute', snapValue: 15 snaps to 15-minute increments; snapUnit: 'hour', snapValue: 6 snaps to 6-hour increments.

enableSelection

Default: false

Enable row selection (click, Ctrl+Click, Shift+Click, keyboard).

showCheckboxColumn

Default: true

Show a checkbox column for multi-select. Only applies when enableSelection is true.

enableCriticalPath

Default: false

When true, calculates and highlights the critical path through dependent tasks.

criticalBarColor

Default: '#e53935'

Fill color for task bars on the critical path (requires enableCriticalPath: true).

criticalArrowColor

Default: '#e53935'

Stroke color for dependency arrows on the critical path.

enableRollups

Default: false

When true, summary (parent) rows display thin rollup markers below the summary bar at each leaf descendant's date range, a glance-able overview of children that stays visible even when the parent is collapsed.

Available Options:

  • false (default)
  • true

baseline

Baseline options. When enabled is true, tasks with a baseline field render a thin bar below the actual bar to show schedule variance.

enabled

Options.baseline.enabled
Default: false

Whether to render baseline bars below actual bars.

color

Options.baseline.color
Default: '#BBD5DA'

Color of the baseline bar. When striped is true this paints the stripes; otherwise it fills the whole bar.

striped

Options.baseline.striped

Fill the baseline bar with diagonal stripes that alternate between color and stripeColor, instead of a flat fill. Default true.

stripeColor

Options.baseline.stripeColor

Color of the gaps between stripes. Only used when striped is true. Default '#FFFFFF'.

stripeWidth

Options.baseline.stripeWidth

Width in pixels of each stripe band when striped is true. Larger values produce thicker stripes. Default 3.

stripeAngle

Options.baseline.stripeAngle

Angle in degrees of the stripes when striped is true. Default 45.

dependencies

Visual and interaction options for dependency arrows. Tune cornerRadius for tighter or looser joints, set hitWidth to add an invisible thicker target zone for hover/click on thin strokes, and use tooltipTemplate / classBuilder for per-arrow content and styling.

dependencies: {
  cornerRadius: 6,
  hitWidth: 12,
  classBuilder: (ctx) => ctx.fromTask.team !== ctx.toTask.team ? 'cross-team' : '',
  tooltipTemplate: (ctx) => `<b>${ctx.fromTask.name}</b> → <b>${ctx.toTask.name}</b>`,
}

cornerRadius

Options.dependencies.cornerRadius
Default: 4

Pixel radius for rounded joints on dependency arrows. 0 produces sharp 90° corners; larger values produce smoother arcs (clamped per-corner to half the shorter adjacent segment so an arc never overshoots).

hitWidth

Options.dependencies.hitWidth
Default: 0

Invisible hit-area thickness in pixels. When greater than 0, each arrow renders an additional transparent path of this width that captures pointer events, making the thin visible stroke easier to hover or click. Required for tooltipTemplate to fire.

classBuilder

Options.dependencies.classBuilder

Returns CSS class name(s) for each arrow. Receives a DependencyContext (fromTask, toTask, type, lag) and returns a class name string, an array of class names, or undefined. Use to tag arrows by relationship (cross-team, blocked, optional) and style them via custom CSS.

tooltipTemplate

Options.dependencies.tooltipTemplate

Returns an HTML string shown when the user hovers an arrow. Receives a DependencyContext (fromTask, toTask, type, lag). Requires a non-zero hitWidth so the hover hit area is large enough to register reliably.

editable

Options.dependencies.editable

Enables interactive editing of dependency arrows: hovering darkens the arrow and drag handles appear so users can rewire or delete links. Deletions go through the same undoable command path as removeDependency().

enableCrosshair

Default: false

Show a vertical crosshair line that follows the cursor across the timeline, with a label displaying the precise date or time at the pointer position.

Available Options:

  • false (default)
  • true

crosshairColor

Default: '#87B7FE'

Color of the crosshair line and label background. Theme-aware.

crosshairLabelFormat

Custom formatter for the crosshair label text. Receives the date under the cursor and the current sub-tier of the timeline header ('minute' | 'hour' | 'halfday' | 'day' | 'week' | 'month' | 'quarter' | 'year'). When omitted, the label auto-adapts to the active tier: coarse formats for week-and-above, HH:mm for halfday, hour, or minute tiers.

crosshairLabelFormat(date, tier) {
  return `${tier}: ${date.toISOString()}`;
}

enableTooltip

Default: true

Show a tooltip on task-bar hover.

tooltipId

Default: 'apexgantt-tooltip-container'

HTML id for the tooltip container element.

tooltipTemplate

Custom function returning an HTML string for the task tooltip.

tooltipTemplate(task, dateFormat) {
  return `
    <div>
      <div><strong>Task:</strong> ${task.name}</div>
      <div><strong>Start:</strong> ${task.startTime}</div>
      <div><strong>End:</strong> ${task.endTime}</div>
      <div><strong>Progress:</strong> ${task.progress}%</div>
    </div>
  `;
}

tooltipBGColor

Default: '#FFFFFF'

Background color of the hover tooltip.

tooltipBorderColor

Default: '#BCBCBC'

Border color of the hover tooltip.

fontColor

Default: '#000000'

Color for all text in the chart.

fontFamily

Default: 'sans-serif'

CSS font-family for the chart. Falls back to the page default when empty.

fontSize

Default: '14px'

CSS font-size for the chart.

fontWeight

Default: '400'

CSS font-weight for the chart.

annotationBgColor

Default: '#DBEAFE'

Background color of annotation markers.

annotationBorderColor

Default: '#60A5FA'

Border color of annotation markers.

annotationBorderDashArray

Default: []

SVG stroke-dasharray for annotation borders, e.g. [6, 3].

annotationBorderWidth

Default: 2

Border width of annotation markers in pixels.

annotationOrientation

Default: 'horizontal'

Whether annotation lines are drawn horizontally or vertically.

Available Options:

  • horizontal (default)
  • vertical

enableProjectBoundary

Default: false

When true, two vertical lines mark the project's earliest start and latest end across all rows. Auto-recomputes when tasks are added, removed, or rescheduled.

Available Options:

  • false (default)
  • true

projectBoundaryColor

Default: '#7C3AED'

Stroke color for the project-boundary lines. Falls back to annotationBorderColor when omitted.

columnConfig

Custom column definitions for the task-list panel. When omitted, all default columns are shown.

key

Options.columnConfig.key

Column identifier. Use a ColumnKey value for built-ins ('name', 'startTime', 'endTime', 'duration', 'progress', 'progressRing', 'wbs', 'predecessors', 'successors', 'assignees', 'baselineStart', 'baselineEnd', 'baselineVariance') or any other string for a custom column paired with a render function.

title

Options.columnConfig.title

Header label displayed at the top of the column.

minWidth

Options.columnConfig.minWidth

CSS min-width for the column, e.g. '120px'. Acts as the column's preferred width when autoSizeColumns is on.

maxWidth

Options.columnConfig.maxWidth

Upper bound for the auto-sized column width, e.g. '240px'. Caps how wide the column grows to fit content so one long value can't dominate the panel. Ignored when autoSizeColumns is off. Default '320px'.

flexGrow

Options.columnConfig.flexGrow

CSS flex-grow factor for the column.

visible

Options.columnConfig.visible

Whether the column is visible. Defaults to true.

resizable

Options.columnConfig.resizable

Whether this column can be resized by dragging the handle at its header's trailing edge. Requires the resizableColumns option. Set false to lock a single column at its auto/configured width. Default true.

render

Options.columnConfig.render

Custom cell renderer. Required for custom columns; ignored for built-in columns. Receives a context object (task, options, rowIndex, isSummary, isMilestone) and the cell element. Return an HTML string to set innerHTML, return void if you mounted DOM yourself, or return a cleanup function () => void that the library will invoke on row eviction, full re-render, and destroy(): required for framework adapters (React.createRoot().unmount(), Vue.app.unmount(), etc.).

accessor

Options.columnConfig.accessor

Extracts the underlying value of the cell from the task. Used by sorting, filtering, and SVG export. Optional for built-in columns; for a custom column it is what makes the column sortable and filterable.

sortable

Options.columnConfig.sortable

Whether the column participates in sorting (header click plus the sortBy option and gantt.sort()). Defaults to true for built-in value columns, false for the Wbs column, and true for a custom column only when an accessor or comparator is supplied.

comparator

Options.columnConfig.comparator

Custom sort comparator for the column. Takes precedence over accessor-based comparison. Receives two tasks and returns a negative, zero, or positive number for ascending order; the active sort direction is applied on top. Stable: equal results fall back to natural (input) order.

toolbarItems

Default: []

Custom controls rendered in the toolbar alongside the built-in zoom and export buttons. Each item can be a ToolbarButton, ToolbarSelect, or ToolbarSeparator. Use position: 'left' to insert before the built-in controls (default is 'right').

taskListAriaLabel

Default: 'Task list'

aria-label for the task-list table, used by screen readers.

locale

Localization, date-locale, and text-direction options. Defaults to { direction: 'ltr' }, which reproduces the pre-localization output. See the Localization and RTL guide for worked examples.

direction

Options.locale.direction
Default: 'ltr'

Text and layout direction.

Available Options:

  • ltr (default): left-to-right
  • rtl: mirrors the timeline horizontally (time flows right-to-left, the task list moves to the right) and sets dir="rtl" on the container
  • auto: defers to the document or element's inherited direction

dateLocale

Options.locale.dateLocale

dayjs-compatible locale object used to format every date, month, and weekday in the timeline. Import one from dayjs/locale/* (e.g. import localeFr from 'dayjs/locale/fr') and pass it here. ApexGantt registers it on its own bundled dayjs instance, so the host does not need to import dayjs locales.

name

Options.locale.dateLocale.name

Locale identifier, e.g. 'fr' or 'en'.

weekdays

Options.locale.dateLocale.weekdays

Full weekday names, Sunday first.

weekdaysShort

Options.locale.dateLocale.weekdaysShort

Abbreviated weekday names, Sunday first.

weekdaysMin

Options.locale.dateLocale.weekdaysMin

Minimal weekday names, Sunday first.

months

Options.locale.dateLocale.months

Full month names, January first.

monthsShort

Options.locale.dateLocale.monthsShort

Abbreviated month names, January first.

weekStart

Options.locale.dateLocale.weekStart

Index of the first day of the week, where 0 is Sunday.

yearStart

Options.locale.dateLocale.yearStart

Week-of-year calculation rule: the day of January that the first week of the year must contain.

formats

Options.locale.dateLocale.formats

Named date-format tokens keyed by dayjs format name (e.g. LT, LL).

relativeTime

Options.locale.dateLocale.relativeTime

Templates for relative-time strings, keyed by dayjs unit (e.g. future, past, dd).

meridiem

Options.locale.dateLocale.meridiem

Function returning the AM/PM string for a given hour, minute, and lowercase flag.

ordinal

Options.locale.dateLocale.ordinal

Function returning the ordinal form of a number, e.g. 1 to 1st.

messages

Options.locale.messages

Overrides for the Gantt's generated strings. Accepts a partial set; unset keys keep their English defaults. Plain labels are strings; strings that embed runtime data are functions.

addTask

Options.locale.messages.addTask
Default: 'Add task'

"Add task" toolbar button label.

deleteSelected

Options.locale.messages.deleteSelected
Default: 'Delete selected'

"Delete selected" toolbar button label.

undo

Options.locale.messages.undo
Default: 'Undo (Ctrl+Z)'

Undo toolbar button label.

redo

Options.locale.messages.redo
Default: 'Redo (Ctrl+Y)'

Redo toolbar button label.

exportAsSvg

Options.locale.messages.exportAsSvg
Default: 'Export as SVG'

Export toolbar button label for the SVG format.

exportAsPng

Options.locale.messages.exportAsPng
Default: 'Export as PNG'

Export toolbar button label for the PNG format.

exportAsPdf

Options.locale.messages.exportAsPdf
Default: 'Export as PDF'

Export toolbar button label for the PDF format.

quickFilterPlaceholder

Options.locale.messages.quickFilterPlaceholder
Default: 'Search tasks…'

Placeholder for the built-in quick-filter search box.

filterButton

Options.locale.messages.filterButton
Default: 'Filter'

Advanced filter builder toolbar button label.

filterHeading

Options.locale.messages.filterHeading
Default: 'Filter tasks'

Filter builder popover heading.

filterMatchLabel

Options.locale.messages.filterMatchLabel
Default: 'Match'

Filter builder match-mode label.

filterMatchAll

Options.locale.messages.filterMatchAll
Default: 'All'

Filter builder match-all (AND) option label.

filterMatchAny

Options.locale.messages.filterMatchAny
Default: 'Any'

Filter builder match-any (OR) option label.

filterAddCondition

Options.locale.messages.filterAddCondition
Default: '+ Add condition'

Filter builder add-condition button label.

filterApply

Options.locale.messages.filterApply
Default: 'Apply'

Filter builder apply button label.

filterClear

Options.locale.messages.filterClear
Default: 'Clear'

Filter builder clear button label.

filterRemoveCondition

Options.locale.messages.filterRemoveCondition
Default: 'Remove condition'

Filter builder remove-condition button aria-label.

filterNoConditions

Options.locale.messages.filterNoConditions
Default: 'No conditions yet.'

Filter builder empty-state text shown when no conditions exist.

filterOperatorLabel

Options.locale.messages.filterOperatorLabel

Function returning the human-readable label for a comparison operator.

groupNone

Options.locale.messages.groupNone
Default: '(None)'

Group header label for tasks whose group value is empty.

groupCountLabel

Options.locale.messages.groupCountLabel

Function returning the group header member-count label from the count, e.g. (3).

exportFailedNoChart

Options.locale.messages.exportFailedNoChart
Default: 'Export failed: Chart not found. Please refresh and try again.'

Alert shown when export cannot find the chart.

exportFailedGeneric

Options.locale.messages.exportFailedGeneric
Default: 'Export failed. Please check the console for details.'

Generic export-failure alert.

editTask

Options.locale.messages.editTask
Default: 'Edit task'

Context-menu "Edit task" label.

addChildTask

Options.locale.messages.addChildTask
Default: 'Add child task'

Context-menu "Add child task" label.

addSiblingTask

Options.locale.messages.addSiblingTask
Default: 'Add sibling task'

Context-menu "Add sibling task" label.

indent

Options.locale.messages.indent
Default: 'Indent'

Context-menu "Indent" label.

outdent

Options.locale.messages.outdent
Default: 'Outdent'

Context-menu "Outdent" label.

deleteTask

Options.locale.messages.deleteTask
Default: 'Delete task'

Context-menu delete label for a leaf task.

deleteTaskWithChildren

Options.locale.messages.deleteTaskWithChildren
Default: 'Delete (with children)'

Context-menu delete label for a task with children.

formTaskName

Options.locale.messages.formTaskName
Default: 'Task Name'

Task-form name field label.

formStartDate

Options.locale.messages.formStartDate
Default: 'Start Date'

Task-form start-date field label.

formEndDate

Options.locale.messages.formEndDate
Default: 'End Date'

Task-form end-date field label.

formProgress

Options.locale.messages.formProgress
Default: 'Progress (%)'

Task-form progress field label.

formSubmit

Options.locale.messages.formSubmit
Default: 'Update'

Task-form submit button label.

editTaskTitle

Options.locale.messages.editTaskTitle

Function returning the edit-task dialog title from the task name.

validationStartRequired

Options.locale.messages.validationStartRequired
Default: 'Start date is required'

Validation message shown when the start date is missing.

validationEndRequired

Options.locale.messages.validationEndRequired
Default: 'End date is required'

Validation message shown when the end date is missing.

validationEndAfterStart

Options.locale.messages.validationEndAfterStart
Default: 'End date must be after start date'

Validation message shown when the end date is not after the start date.

validationNameRequired

Options.locale.messages.validationNameRequired
Default: 'Task name is required'

Validation message shown when the task name is missing.

validationProgressRequired

Options.locale.messages.validationProgressRequired
Default: 'Progress is required'

Validation message shown when progress is missing.

validationProgressRange

Options.locale.messages.validationProgressRange
Default: 'Progress must be between 0 and 100'

Validation message shown when progress falls outside 0 to 100.

addTaskRowLabel

Options.locale.messages.addTaskRowLabel
Default: '+ Add task'

Visible label on the inline add-task row.

baselineLabel

Options.locale.messages.baselineLabel
Default: 'Baseline:'

Baseline tooltip "Baseline:" label.

startLabel

Options.locale.messages.startLabel
Default: 'Start:'

Baseline tooltip "Start:" label.

endLabel

Options.locale.messages.endLabel
Default: 'End:'

Baseline tooltip "End:" label.

summaryAriaLabel

Options.locale.messages.summaryAriaLabel

Function that builds a summary-bar aria-label from a context object (name, canToggle, collapsed).

barAriaLabel

Options.locale.messages.barAriaLabel

Function that builds an interactive or read-only bar aria-label from a context object (name, start, end, and progress for read-only bars).

barAriaValueText

Options.locale.messages.barAriaValueText

Function that builds the bar aria-valuetext for interactive bars from a context object (start, end, durationDays).

progressAriaLabel

Options.locale.messages.progressAriaLabel

Function that builds the progress-handle aria-label from the task name.

parsing

Field-mapping config to parse non-standard task shapes without manual data transformation.

parsing: {
  id: 'task_id',
  name: 'title',
  startTime: 'start_date',
  endTime: 'end_date',
  progress: { key: 'pct_complete', transform: Number },
}

id

Options.parsing.id

Path to the unique task identifier in the raw data object.

name

Options.parsing.name

Path to the task display name in the raw data object.

startTime

Options.parsing.startTime

Path to the task start date in the raw data object.

endTime

Options.parsing.endTime

Path to the task end date in the raw data object.

progress

Options.parsing.progress

Path to the task progress value in the raw data object.

type

Options.parsing.type

Path to the task type ('task' or 'milestone') in the raw data object.

parentId

Options.parsing.parentId

Path to the parent task ID in the raw data object.

dependency

Options.parsing.dependency

Path to the dependency field in the raw data object.

barBackgroundColor

Options.parsing.barBackgroundColor

Path to a per-task bar color override in the raw data object.

rowBackgroundColor

Options.parsing.rowBackgroundColor

Path to a per-task row background color override in the raw data object.

collapsed

Options.parsing.collapsed

Path to the collapsed state in the raw data object.

series

Task data array. Each item must satisfy TaskInput, or use parsing to map custom field names.

series: [
  {
    id: 'task-1',
    name: 'Design Phase',
    startTime: '01-01-2026',
    endTime: '01-15-2026',
    progress: 65,
  },
  {
    id: 'task-2',
    name: 'Development',
    startTime: '01-10-2026',
    endTime: '02-01-2026',
    parentId: 'task-1',
    progress: 30,
    dependency: 'task-1',
  },
]

id

Options.series.id

Unique identifier for the task. Must be stable across renders.

name

Options.series.name

Display name shown in the task list column and task bar.

startTime

Options.series.startTime

Task start date string. Parsed using inputDateFormat.

endTime

Options.series.endTime

Task end date string. Parsed using inputDateFormat. When omitted, the task renders as a milestone on startTime.

progress

Options.series.progress

Completion percentage (0–100). Renders a filled progress portion inside the task bar.

type

Options.series.type

Visual type of the task.

Available Options:

  • task: renders a bar (default)
  • milestone: renders a diamond marker

parentId

Options.series.parentId

ID of the parent task. Nested tasks are rendered as children in the task list.

dependency

Options.series.dependency

Dependency on another task. Accepts either a plain task ID string (treated as Finish-to-Start with 0 lag) or a full TaskDependency object for typed dependency with lag/lead support.

// Simple string dependency
dependency: 'task-2'

// Full dependency object
dependency: { taskId: 'task-2', type: 'FS', lag: 2 }

barBackgroundColor

Options.series.barBackgroundColor

Override the task bar fill color for this specific task.

rowBackgroundColor

Options.series.rowBackgroundColor

Override the row background color for this specific task row.

baseline

Options.series.baseline

Baseline (planned) dates for comparison against actual dates. Rendered as a thin bar below the actual task bar when baseline.enabled is true.

start

Options.series.baseline.start

Planned (baseline) start date of the task.

end

Options.series.baseline.end

Planned (baseline) end date of the task.

collapsed

Options.series.collapsed

Whether this task's child tasks are collapsed (hidden) in the task list.

showSummaryBar

Options.series.showSummaryBar

When true (the default), a task with children renders as a summary (group) bar whose date range is automatically computed from the earliest start and latest end of all its descendants: the task's own startTime / endTime are ignored. Drag, resize, and progress edits are disabled on summary bars. Set to false to opt the parent out of the auto-derived summary bar and render it as a normal task bar instead.

assignees

Options.series.assignees

People (or teams) assigned to this task. Consumed by the built-in renderers.avatars column renderer; ignored unless an avatar-style column is configured via columnConfig. Each Assignee carries name, optional avatarUrl, optional initials, and optional fallback color.

segments

Options.series.segments

Worked spans of a split task. When two or more are provided, the task renders as separate bar pieces with gaps between them, and its startTime / endTime are derived from the segments (first start to last end). Omit, or provide fewer than two, for a normal contiguous task. Split a task at runtime via gantt.splitTask().

annotations

Array of annotation objects to overlay on the timeline.

annotations: [
  {
    x1: '01-15-2026',
    x2: '01-20-2026',
    label: { text: 'Sprint Review' },
  },
  {
    x1: '02-01-2026',
    label: { text: 'Deadline' },
  },
]

x1

Options.annotations.x1

Start date of annotation.

x2

Options.annotations.x2

End date of annotation. If present, draws a rect from x1 to x2. If null or omitted, only draws a line on x1.

bgColor

Options.annotations.bgColor

Background color of this annotation. Overrides the global annotationBgColor.

borderColor

Options.annotations.borderColor

Border color of this annotation. Overrides the global annotationBorderColor.

borderDashArray

Options.annotations.borderDashArray

SVG stroke-dasharray for this annotation's border.

borderWidth

Options.annotations.borderWidth

Border width of this annotation in pixels.

label

Options.annotations.label

Label configuration for the annotation.

text

Options.annotations.label.text

Label text for the annotation.

fontColor

Options.annotations.label.fontColor

Font color for the annotation label.

fontFamily

Options.annotations.label.fontFamily

Font family for the annotation label.

fontSize

Options.annotations.label.fontSize

Font size for the annotation label.

fontWeight

Options.annotations.label.fontWeight

Font weight for the annotation label.

orientation

Options.annotations.label.orientation

Text orientation of the annotation label.

Available Options:

  • horizontal
  • vertical

calendar

Working-calendar configuration. When set, weekends and holidays drive duration math, summary aggregation, and timeline stripes. Absent means every day is a working day. See the Calendar and Working Days guide.

workingWeekdays

Options.calendar.workingWeekdays

Weekdays that count as working days, where 0 is Sunday and 6 is Saturday. Default [1, 2, 3, 4, 5] (Mon–Fri).

holidays

Options.calendar.holidays

Specific non-working dates, regardless of weekday. Each entry may be a date string, a Date, or { date, label } for a tooltipped holiday. Default [].

showNonWorkingStripes

Options.calendar.showNonWorkingStripes

Render hatched bands over non-working timeline columns. Default true.

holidayTooltip

Options.calendar.holidayTooltip

Optional function returning an HTML string shown when hovering a holiday stripe. Receives { date, label }.

dragSnapMode

Options.calendar.dragSnapMode

Where a drag or resize lands when it hits a non-working day.

Available Options:

  • next (default): snap forward to the next working day
  • previous: snap backward to the previous working day
  • allow: permit non-working start/end dates

history

Undo/redo history configuration. Every mutating call (drag, resize, inline/dialog edit, add, delete, move, dependency change) is recorded unless disabled. See the Undo and Redo guide.

enabled

Options.history.enabled

When false, no commands are recorded and undo() / redo() are no-ops. Default true.

maxSize

Options.history.maxSize

Maximum number of undo entries retained; older entries drop off the bottom (FIFO). Default 100.

beforeTaskAdd

Veto hook called immediately before a task is inserted via addTask(). Return false (or a promise resolving to false) to cancel the insertion. Useful for permissions or payload validation.

beforeTaskUpdate

Veto hook called before any task update commits (drag, resize, progress drag, inline/dialog edit, or programmatic updateTask()). Return false to reject the change; a taskValidationError event fires and the chart reverts. See the Inline Editing guide.

beforeTaskMove

Veto hook called before a task is re-parented via moveTask() or an indent/outdent. Return false to cancel the move.

beforeTaskDelete

Veto hook called before a task is removed via deleteTask(). Return false to cancel the deletion.

beforeDependencyChange

Veto hook called before a dependency is added or removed (interactively or via addDependency() / removeDependency()). Return false to reject the change.