TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/svar-widgets/gantt/llms.txt
Use this file to discover all available pages before exploring further.
Toolbar component renders a row of action buttons above the Gantt chart. When connected via the api prop it automatically enables and disables built-in buttons based on the current selection and chart state.
Basic setup
Place
Toolbar before the Gantt element so it renders above the chart. Adjust the height of the chart container to account for the toolbar’s height.Toolbar props
The Gantt API object. Connects the toolbar so built-in button states (enabled/disabled) track the chart selection.
Array of button descriptors. Overrides the default button set.
Default toolbar buttons
ThedefaultToolbarButtons array and the getToolbarButtons() helper give you a copy of the built-in button configuration:
| ID | Description |
|---|---|
add-task | Add a new task |
edit-task | Open the editor for the selected task |
delete-task | Delete the selected task |
move-task:up | Move the selected task up |
move-task:down | Move the selected task down |
copy-task | Copy the selected task |
cut-task | Cut the selected task |
paste-task | Paste the clipboard task |
indent-task:add | Indent the selected task (make it a child) |
indent-task:remove | Outdent the selected task |
{ comp: "separator" }.
Customising the button list
CallgetToolbarButtons() to get a modifiable copy of the defaults, then filter or extend it before passing to Toolbar:
Fully custom toolbar
You can build a completely custom toolbar by constructing theitems array yourself and wiring handlers that call api.exec:
Button config fields
Unique identifier for the button. Used to match the action dispatched when the button is clicked.
The control type.
"button" renders a labelled button, "icon" renders an icon-only button, "separator" renders a visual divider.Button label (for
comp: "button") or keyboard shortcut hint (for comp: "icon").Icon class name (e.g.
"wxi-plus").Visual style variant, e.g.
"primary", "secondary", "danger".Click handler for custom buttons. Built-in buttons handle their own actions automatically.
Function returning
true to disable the button based on the current task, state, or target.Function returning
true to hide the button based on the current task, state, or target.