Initialization
This guide walks through the process of adding a Kanban board to a web page, so you can easily bring Kanban functionality into your app. Here’s how to get everything set up and ready to use:
- Include the Kanban source files on a page.
- Create a container for Kanban.
- Initialize Kanban with a constructor.
Including source files
First, download the package and unzip it somewhere in your project folder.
To get Kanban working, just include these two files in your HTML:
- kanban.js
- kanban.css
Be sure the paths to the files are correct for your project:
<script type="text/javascript" src="./dist/kanban.js"></script>
<link rel="stylesheet" href="./dist/kanban.css">
Creating container
Set up a container for Kanban in your HTML and give it an ID, like "root":
<div id="root"></div>
If you want to add a Toolbar along with the Kanban board, set up a separate container for it as well:
<div id="toolbar"></div> // container for Toolbar
<div id="root"></div> // container for Kanban
Initializing Kanban
To get Kanban up and running, use the kanban.Kanban constructor. It needs two things:
- the HTML container (just pass the container’s ID)
- an object with configuration options. Check out the full list here
// create Kanban
new kanban.Kanban("#root", {
// configuration properties
});
If you’re adding a Toolbar too, it gets initialized separately with the kanban.Toolbar constructor. The setup is similar:
- the HTML container (the ID)
- an object with configuration options
// create Kanban
const board = new kanban.Kanban("#root", {
// configuration properties
});
new kanban.Toolbar("#toolbar", {
// configuration properties
});
For more details on setting up the Kanban Toolbar, check out the Configuration section.
Configuration properties
Example
Here’s a quick example showing how to set up Kanban with some starter data: