Skip to main content
The Toolbar component renders an action bar above the Gantt chart. It is connected to the Gantt via the shared api object and dispatches actions (add, edit, delete, move, copy, etc.) directly to the chart.

Import

Basic usage

Place Toolbar before the Gantt component in the markup. Pass the same api reference to both so the toolbar can dispatch actions to the chart.

Props

IApi
required
The Gantt API object. Obtain it by binding this on the Gantt component or via the init callback. The toolbar uses this reference to dispatch task actions.
IButtonConfig[]
Array of button configurations that override the default toolbar items. When omitted, the default set of buttons is used.

Default toolbar buttons

When no items prop is provided, the toolbar renders the following buttons:

Customising toolbar items

You can pass a custom items array to add, remove, or reorder buttons. Each object in the array must have at least a comp field.
Import defaultToolbarButtons from @svar-ui/svelte-gantt to start from the built-in set and spread/filter as needed.