taskTypes prop accepts an array of ITaskType objects that
define the set of types available in your Gantt.
Default task types
When thetaskTypes prop is omitted, three types are available out of the box:
- task — a rectangular bar with an optional progress fill
- summary — a bar that spans the date range of its children;
start/end/durationfields are read-only in the editor - milestone — a diamond shape rendered at a single point in time; only
startis editable,endanddurationare hidden
ITaskType fields
Unique identifier for the type. This value is stored in
ITask.type on each task
object. Built-in ids are "task", "summary", and "milestone".Human-readable name shown in the task editor’s type selector and the context menu.
Assigning a type to a task
Set thetype field on a task object to one of the registered type ids:
Adding custom task types
Define additional types by extending thetaskTypes 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 itstype 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.