Data display

Kanban

A board of columns holding cards that can be dragged within a column and between columns, for the stages of a workflow: tasks, leads, orders.

Todo

2
Write the docs
Fix the login bug

Doing

1
New dashboard

Done

1
Release 1.0
Blade

Gray columns side by side, scrolling sideways when they don't fit, each with its title and a count. Dragging a card and dropping it on another column (or elsewhere in the same one) moves it there and fires moved: dropping the first "To do" card at the second place of "Done" calls move('7', 'done', 1).

A column with a subtitle, a red badge and a menu button, a card that is a button opening the task, with a badge above its text and an avatar under it, and an "Add card" button at the bottom of the column.

To do

3 late

Next sprint

Opened: —
Blade

Reference

tk:kanban
└── tk:kanban.column ...
    └── tk:kanban.card ...

tk:kanban

Prop Type Default Description
size string md xs, sm, md, lg, xl, 2xl or 3xl. Sets the spacing, inherited by the columns and cards.

Slots

Slot Description
default The columns.

Events

Event Detail When
moved { card, column, position }: the card's key, the key of the column it was dropped on and its index there, from 0 A card was dropped in a new place.

tk:kanban.column

Prop Type Default Description
key string | int null The column's key, sent in moved.
heading string | slot null The title, translated.
subheading string | slot null Muted text under the title.
count int null A small round badge with the number next to the title.
badge string | slot null A badge next to the title.

Slots

Slot Description
default The cards.
actions Controls at the end of the header.
footer Content under the cards.

tk:kanban.card

Prop Type Default Description
key string | int null The card's key, sent in moved.
as string div button or a makes the card clickable.

Slots

Slot Description
default The card's content.
header, footer Content above and under it.

Events

moved is dispatched on tk:kanban and does not bubble.

With Alpine:

blade

Customization

Classes go to the board, the column's <section> and the card. The column takes prefixes:

Prefix Tag Goes to
header: tk:kanban.column The header.
badge: tk:kanban.column The badge (badge:color="red").
cards: tk:kanban.column The list of cards.
footer: tk:kanban.column, tk:kanban.card The footer.
header: tk:kanban.card The content above the card's.
blade

Accessibility

Each column is a <section> whose title is an <h3>. Dragging works with a mouse, a pen or touch; there is no keyboard way to move a card, so give keyboard users another one, such as a menu on the card (as="button") with the stages to move it to.

Behavior notes

  • Dropping a card moves it in the page right away. Save the move in moved and render the board in the new order: on the next Livewire update the board shows what the server sends.
  • The columns don't change their counts by themselves; they show what you pass.