DHTMLX Kanban. Svelte integration example
This demo shows how to embed DHTMLX Kanban into a Svelte application. The Kanban board initalizes as a vanilla JavaScript widget inside a Svelte component. For a step-by-step setup guide, see the detailed Svelte integration guide.
Try it online
View on GitHub. Open the repository and click "Open in Codespaces" on the README page to launch a fully configured Svelte app with DHTMLX Kanban. No local setup required.
Solution overview
- Create a custom
Kanban.sveltecomponent - Use the
bind:thisdirective to access DOM elements for Kanban and Toolbar containers - Declare
export letprops forcolumns,cards, androwsdata, and thecardShapeconfig in the Svelte component - In the
onMountlifecycle hook, initialize Kanban with thenew Kanban(kanban_container, { columns, cards, rows, rowKey, cardShape, editorShape, currentUser })constructor - Call the
new Toolbar(toolbar_container, { api: kanban.api })constructor to create a Toolbar instance and bind it to Kanban - In the
onDestroylifecycle hook, calldestructor()to clean up DOM nodes and event listeners for Kanban and Toolbar
API reference
- Kanban constructor: Creates a new Kanban instance
- columns: Defines the board columns
- cards: Defines the task cards
- rows: Defines swimlane rows
- cardShape: Configures which card fields are visible
- editorShape: Configures the card editor fields
- Toolbar: Toolbar widget overview