IGanttColumn type defines a column in the Gantt’s left-side grid. Pass an array of column definitions to the columns prop on the <Gantt> component.
TypeScript definition
Fields
string
The field name from the task object to display in this column. For example,
"text" renders the task’s text property. Built-in special IDs include "add-task" (renders the add-task button column).string | object | Array
Column header configuration. Accepts:
- A plain string label
- An object
{ text: string, css?: string }for styled headers - An array for multi-row headers (one entry per header row)
number
Fixed column width in pixels. Use
flexgrow instead for proportional sizing.number
Flex-grow factor for proportional width distribution among columns that have
flexgrow set. Works similarly to CSS flex-grow.'left' | 'right' | 'center'
default:"left"
Horizontal alignment of cell content.
boolean
default:"false"
When
true, the user can drag the column border to resize it.boolean
default:"false"
When
true, clicking the column header sorts tasks by this column.(task: ITask) => string
A function returning an HTML string to render in the cell body. Use this to customize the cell content beyond the raw field value.
Component
A Svelte component rendered as the cell body. Receives the task object as a prop. Use when you need reactive Svelte markup inside a cell.
object
Inline cell editor configuration. Defines the input type and options used when a user clicks to edit the cell. Mirrors the editor config from
@svar-ui/svelte-grid.Array
Options array for editor fields of type
select, combo, or multiselect. Each option is { id: any, label: string }.(obj: IDataHash) => any
Custom accessor function that derives the display value from the task object. Use when the field to display is not a direct property (e.g., formatted dates, combined fields).
Examples
- Basic columns
- With inline editor
- Using defaultColumns
Pass
columns={false} to the <Gantt> component to hide the grid entirely and show only the chart.