Skip to main content
Task types control how bars are rendered on the chart and which fields are editable in the task editor. The taskTypes prop accepts an array of ITaskType objects that define the set of types available in your Gantt.

Default task types

When the taskTypes prop is omitted, three types are available out of the box:
Each type produces a distinct visual representation:
  • task — a rectangular bar with an optional progress fill
  • summary — a bar that spans the date range of its children; start/end/duration fields are read-only in the editor
  • milestone — a diamond shape rendered at a single point in time; only start is editable, end and duration are hidden

ITaskType fields

string | number
required
Unique identifier for the type. This value is stored in ITask.type on each task object. Built-in ids are "task", "summary", and "milestone".
string
required
Human-readable name shown in the task editor’s type selector and the context menu.

Assigning a type to a task

Set the type field on a task object to one of the registered type ids:

Adding custom task types

Define additional types by extending the taskTypes array. The id you choose becomes a CSS class applied to the task bar element (prefixed with wx-), which lets you style custom types with plain CSS. The example below is taken from GanttTaskTypes.svelte and data.js:

Styling custom types

Each task bar receives a CSS class equal to its type value. Target it under the .wx-gantt .wx-bar.wx-task selector:
Only types with id matching "task", "summary", or "milestone" receive special behavioral treatment (e.g. date-field restrictions in the editor). All other type ids are treated as variants of "task" for editing purposes and differ only in appearance.