DHTMLX Kanban. React integration example
This demo shows how to embed DHTMLX Kanban into a React application. The Kanban board initializes as a vanilla JavaScript widget inside a functional React component. For a step-by-step setup guide, see the detailed React integration guide.
Try it online
View on GitHub. Open the repository and click the "Open in Codespaces" button on the README page to launch a fully configured React app with DHTMLX Kanban. No local setup required.
Solution overview
- Create a custom
KanbanComponent - Use the
useRef()hook to get references for Kanban and Toolbar containers - In the
useEffecthook, initialize Kanban with thenew Kanban(kanban_container.current, { columns, cards, rows, rowKey, cardShape, editorShape, currentUser })constructor - Call the
new Toolbar(toolbar_container.current, { api: kanban.api })constructor to create a Toolbar instance and bind it to Kanban - Use
destructor()to clean up DOM nodes and event listeners on unmount 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