Kanban board: a row of tinted columns holding cards that are dragged between them.
<.kanban id="funnel" event="move" aria-label="Sales funnel" style="--cols:3">
<.kanban_column id="col-open" list="open" label="Open" count={length(@open)} color="primary">
<.kanban_card :for={card <- @open} id={"card-#{card.id}"} item={card.id}>
<b>{card.title}</b>
</.kanban_card>
<:empty>Drop here</:empty>
</.kanban_column>
<.kanban_lost label="Lost" count={3} list="lost" />
</.kanban>The board is one LedgerUI.Sortable hook (priv/static/ledger_ui/hooks/sortable.js): columns are
lists, cards are items, and a drop pushes event (to target when given) with
%{"id" => item, "from" => list, "to" => list, "index" => position}. Nothing is moved in the
browser: the server's render is the new order. data-list/data-id are only rendered when
list/item are given; the hook falls back to the element ids.
A column with a limit turns its pill and bar red (data-wip="exceeded") when count goes over
it. The board is role="group" when it has an aria-label. --cols in style sets the grid
columns; without it the columns are 272px wide in a row that scrolls sideways (fluid shares
the width instead).
The same hook sorts any list: put phx-hook="LedgerUI.Sortable" on it with data-list,
data-event, data-group, data-handle, data-axis, data-target, data-disabled; items
carry data-id.
Summary
Functions
Attributes
id(:string) (required)event(:string) - Defaults tonil.target(:any) - Defaults tonil.group(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.fluid(:boolean) - Defaults tofalse.active(:string) - Phone mode: the column shown below 640px. Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Attributes
id(:string) (required)item(:any) - Defaults tonil.risk(:boolean) - Defaults tofalse.dense(:boolean) - Defaults tofalse.grip(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
actionsinner_block(required)
Attributes
id(:string) (required)list(:string) - Defaults tonil.label(:string) (required)count(:any) - Defaults tonil.count_label(:string) - Defaults tonil.over_limit(:boolean) - Defaults tofalse.hint(:string) - Defaults to"empty". Must be one of"empty", or"always".active(:boolean) - Defaults tofalse.color(:string) - Defaults tonil.Must be one ofnil,"neutral","info","warning","primary","teal", or"success".limit(:integer) - Defaults tonil.meta(:string) - Defaults tonil.total(:string) - Defaults tonil.progress(:integer) - Defaults tonil.disabled(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
actionsiconfooterinner_blockempty- Accepts attributes:title(:string)icon(:string)
Attributes
label(:string) (required)count(:integer) - Defaults tonil.meta(:string) - Defaults tonil.list(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
icon