Initialization
Here's how to quickly set up Kanban on a page and add all the board features to your app. Just follow these steps to get the component working:
- 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 unpack it somewhere in your project folder.
For Kanban to work, just add these two files to your page:
- kanban.js
- kanban.css
Make sure the paths to those files are correct:
<script type="text/javascript" src="./dist/kanban.js"></script>
<link rel="stylesheet" href="./dist/kanban.css">
Creating container
Add a container element for Kanban and assign it an ID, like "root":
<div id="root"></div>
If you want the Kanban board to have a Toolbar, add a separate container for it as well:
<div id="toolbar"></div> // container for Toolbar
<div id="root"></div> // container for Kanban
Initializing Kanban
Kanban gets initialized using the kanban.Kanban constructor. It expects two arguments:
- an HTML container (the ID of the HTML container)
- an object with configuration properties. See the full list here
// create Kanban
new kanban.Kanban("#root", {
// configuration properties
});
If you're adding a Toolbar as well, initialize it separately with the kanban.Toolbar constructor. It also needs two arguments:
- an HTML container (the ID of the HTML container)
- an object with configuration properties
// create Kanban
const board = new kanban.Kanban("#root", {
// configuration properties
});
new kanban.Toolbar("#toolbar", {
// configuration properties
});
More details on setting up the Kanban Toolbar can be found in the Configuration section.
Configuration properties
Example
Here's a snippet that shows Kanban being initialized with some starting data: