Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Data

Kanban <pm-kanban>

Kanban board: columns of cards that people move between stages, for a sales pipeline, tasks or hiring.

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/kanban'; </script> <pm-kanban label="Sales pipeline" addable columns='[{"id":"lead","title":"Lead"},{"id":"qualified","title":"Qualified","tone":"info"},{"id":"proposal","title":"Proposal","tone":"warning","limit":2},{"id":"won","title":"Won","tone":"success"}]' items='[{"id":"1","column":"lead","title":"Northwind Traders","text":"Asked for a demo of the reporting add-on.","tags":["Inbound"],"meta":"$4,800","assignee":"Ada Lovelace"},{"id":"2","column":"lead","title":"Tailspin Toys","tags":[{"label":"Referral","tone":"accent"}],"meta":"$12,000","assignee":"Grace Hopper"},{"id":"3","column":"qualified","title":"Contoso","text":"Security review booked for Thursday.","tags":["Enterprise"],"meta":"$38,500","assignee":"Linus Torvalds"},{"id":"4","column":"proposal","title":"Fabrikam","text":"Waiting for legal to sign the order form.","tags":[{"label":"Blocked","tone":"danger"}],"meta":"$21,000","assignee":"Ada Lovelace","tone":"danger"},{"id":"5","column":"proposal","title":"Adatum","meta":"$9,200","assignee":"Mina Park"},{"id":"6","column":"won","title":"Litware","tags":[{"label":"Annual","tone":"success"}],"meta":"$16,400","assignee":"Grace Hopper"}]'></pm-kanban>

Overview

Give it columns and items; it draws the cards, so it works the same in every framework. Drag a card with the mouse, or press and hold it on a touch screen. With the keyboard: Space picks a card up, the arrow keys move it within and between columns, Space drops it and Escape puts it back; every step is announced. Enter or a click opens a card (pm-select). A move fires pm-move first: call preventDefault() to refuse it (then nothing changes), otherwise the board reorders itself and detail.items is the new list to save.

Attributes

AttributeTypeDefaultDescription
columnsKanbanColumn[][]The stages, in order: [{ id, title, tone?, limit? }].
itemsKanbanItem[][]The cards: [{ id, column, title, text?, tags?, assignee?, meta?, tone? }]. Their order is the order in each column.
labelstring—Accessible name of the board, e.g. "Sales pipeline".
addablebooleanfalseShow an add button in each column header.
disabledbooleanfalseCards cannot be moved (they can still be opened).
empty-text
prop: emptyText
string—Text of a column without cards (default "No cards").
heading-level
prop: headingLevel
number—Heading level of the column titles, 1 to 6 (default 3).

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-moveonPmMoveA card was dropped in a new place (cancelable).
pm-selectonPmSelectA card was opened.
pm-addonPmAddThe add button of a column was pressed (with addable).

CSS parts

PartDescription
::part(base)The scrolling row of columns.
::part(column)A column.
::part(card)A card.

Methods

move()

Used in templates

Project board