Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Pro (paid add-on)

Kanban

Pro

Kanban is a board of columns and cards, with drag and drop, full keyboard moves, a menu for moving without dragging, and work-in-progress limits.

Part of Pro

This page documents part of @vjdesigns-pro/ui, the paid add-on package. Using it needs a Pro license and @vjdesigns/vjdesigns-ui 3.8.0 or later. Like the free package, it works in both modes, every brand, all 32 languages and right to left. Install it as described in Account forms.

Example

A board of columns and cards: a recruiting pipeline, a season plan, a to-do list. A card's column is its column, and its place in the column is its order in cards. onCardsChange gives you every card in the new order plus the move, so you can save the whole list or just the change.

tsx
import { Kanban, type KanbanCard } from "@vjdesigns-pro/ui";

const [cards, setCards] = useState<KanbanCard[]>([
  { id: "1", column: "watch", title: "Jordan Lee", meta: "Point guard · Class of 2027" },
  { id: "2", column: "offer", title: "Avery Brooks", labels: ["Forward"] },
]);

<Kanban
  aria-label="Recruiting pipeline"
  columns={[
    { id: "watch", title: "Watching" },
    { id: "offer", title: "Offered", limit: 5 },
  ]}
  cards={cards}
  onCardsChange={(next, move) => {
    setCards(next);
    saveMove(move.card.id, move.to); // { column, index }
  }}
  onCardSelect={openProfile}
  onCardAdd={(column) => startNewCard(column)}
/>;

Cards and moves

  • Content: a title, plus an optional description, labels and meta. Or pass renderCard for your own layout; the title still names the card.
  • Moving cards: drag with a mouse or pen, and a dashed placeholder shows where it will land. From the keyboard, Space picks a card up, the arrow keys move it, Space drops it, and Escape puts it back.
  • No dragging needed: each card's menu has Move up, Move down and Move to each column, for touch and single-pointer users. Every move is announced ("Scout Ridge Arena: position 2 of 4 in In progress").
  • Work-in-progress limits: a column's limit shows as "3 of 5", and going over adds an "Over limit" badge (text, not just color). Limits warn; they don't block.

Keyboard

The cards are one Tab stop, and Tab then reaches the focused card's menu. The arrow keys move between cards, Home and End go to the first and last in a column, and Enter opens one.

Props

Kanban

A board of columns and cards: a recruiting pipeline, a season plan, a to-do list. Cards move between and within columns by dragging, from the keyboard, or from each card's menu, and every move is reported with onCardsChange and announced. Columns can show a work-in-progress limit.

Accessibility: each column is a labeled section with a heading and a list of cards. The cards are one Tab stop: arrow keys move between them (Home / End: the column's first and last), Enter opens one, and Space picks it up. While a card is picked up, the arrow keys move it, Space drops it, and Escape puts it back; each step is announced ("Practice plan: position 2 of 4 in In progress"). Each card's menu (Move up, Move down, Move to a column) does the same without dragging, for touch and single-pointer use.

tsx
<Kanban
  aria-label="Recruiting pipeline"
  columns={[{ id: "watch", title: "Watching" }, { id: "offer", title: "Offered", limit: 5 }]}
  cards={cards}
  onCardsChange={(next) => setCards(next)}
  onCardSelect={openProfile}
/>
Kanban props
PropTypeDefault
aria-labelRequired

Accessible name of the board (e.g. "Recruiting pipeline").

string—
columnsRequired

The columns, in order.

readonly KanbanColumn[]—
cards

The cards (controlled). A card's place in its column is its order here.

readonly KanbanCard[]—
defaultCards

Initial cards when uncontrolled.

readonly KanbanCard[]—
onCardsChange

Called after a card moves, with every card in the new order and the move itself.

(cards: KanbanCard[], move: KanbanMove) => void—
onCardSelect

Called when a card is clicked or opened with Enter.

(card: KanbanCard) => void—
onCardAdd

Shows an "Add card" button under each column, called with the column's id.

(column: string) => void—
renderCard

Custom card content, in place of the title, description, labels, and meta. The title still names the card.

(card: KanbanCard) => ReactNode—
columnHeadingLevel

Heading level of the column titles.

234563
columnWidth

Width of each column (CSS length).

string"18rem"
className

Class name for the root.

string—
style

Style for the root.

CSSProperties—

KanbanCard

One card on the board.

KanbanCard props
PropTypeDefault
idRequired

Unique id.

string—
columnRequired

The id of the column it's in.

string—
titleRequired

Short name: shown on the card and used in announcements.

string—
description

A line or two of detail, under the title.

string—
labels

Small tags shown as badges (a position, a priority).

readonly string[]—
meta

One line at the bottom (an owner, a due date).

string—

KanbanColumn

One column of the board.

KanbanColumn props
PropTypeDefault
idRequired

Matched by each card's column.

string—
titleRequired

Column heading.

string—
limit

Work-in-progress limit: the count shows against it, and going over is flagged with text.

number—

KanbanMove

A card's move, as reported with onCardsChange.

KanbanMove props
PropTypeDefault
cardRequiredKanbanCard—
fromRequiredKanbanPosition—
toRequiredKanbanPosition—

KanbanPosition

Where a card is: its column and its index in that column.

KanbanPosition props
PropTypeDefault
columnRequiredstring—
indexRequirednumber—