# Flux 2.0 — Board Records as cards in columns by stage, moved between stages by drag or keyboard. Reference: https://flux.kaptio.com/components/board/ Requires: https://flux.kaptio.com/tokens/v2/flux.css and flux-components.css ## Use it when Shows how many records sit at each stage of a process and lets people move one forward by moving its card. Each column is a stage with a count, each card is a record with its reference, name and key facts. Cards move by their handle: drag it, or focus it and use the keyboard. Every move is announced, the counts update, and the board dispatches flux-board-move so the product can save the new stage. ## Do not use it when Not for a long list that people sort, filter and scan; use a Table with a status column. Not for reordering one list; use Reorder. Not when a stage change needs a reason or a confirmation every time; open a Modal from the card instead of letting a drag commit it. ## Markup ### Quotes by stage
Golden Circle, Nordic Trails
Ring Road self-drive, Lindqvist family
Northern Lights, Polar Agency
South Coast, Aurora Schools
Snæfellsnes, private group
Glacier walk, Nordic Trails
Golden Circle, Anna Lindqvist
Press Space to pick the card up. The arrow keys move it within a column and between columns. Press Space to drop it, or Escape to put it back.
## API - flux-board (class): The board. data-flux-board adds dragging, keyboard moves, announcements and counts. Give it role="region", a name and tabindex="0". - flux-board__column | __header | __title | __count (class): A stage: its section, heading row, heading and count. - flux-board__cards (class): The ordered list of cards in a stage. It keeps a minimum height so an empty stage is still a drop target. - flux-board__card | __ref | __name | __meta (class): A card and its reference, name and facts. - flux-board__handle (class): The move button. aria-pressed is true while the card is lifted. - flux-board-move (element): Cancelable event dispatched on the board after a move. detail holds card, from and to columns, and index. A framework that renders the cards cancels it: the card goes back where it started and the framework renders the move. ## Accessibility - Every pick-up, move and drop is announced with the column and position, through an assertive live region. - The handle carries the instructions through aria-describedby. - Columns are sections named by their headings, so a screen reader can jump between stages. - Offer another way to change a stage too, such as a status select on the record, for people who cannot drag. ## Keyboard - Space / Enter: On a handle, picks the card up; pressed again, drops it. - Arrow Up / Arrow Down: Moves the lifted card within its column. - Arrow Left / Arrow Right: Moves the lifted card to the previous or next column. - Escape: Puts the lifted card back where it was. ## Tokens - --flux-board-column-width | -gap | -column-bg | -column-padding - --flux-board-card-bg | -card-border | -card-padding | -card-gap - --flux-board-lifted-shadow | -drop-border ## Do - Order columns the way records move, left to right. - Save on flux-board-move and move the card back if the save fails, with an error toast. ## Do not - Do not put a status badge on a card; the column is the status. - Do not colour columns. The stage name and count carry it.