Skip to content
OGE logoOGE

Kanban API

Complete API reference for @oge-ui/kanban. The kernel — card normalization and write-back, the drag hit-testing, per-column virtual windows, the WIP arithmetic, the keyboard and move machines — is the framework-free @oge-ui/kanban-engine, shared with the React board; live demos are on the overview page.

Properties Methods Events Types

OgeKanban

oge-kanban

Properties 33

Data

Name Type DefaultDescription
dataSourcereadonly T[][]Card items — a plain array, copied into an internal working set; the input is never mutated. Edits surface through the past-tense events.
keyExpr / columnExpr / titleExpr / descriptionExpr / colorExprstring | ((item: T) => unknown)'id' / 'status' / 'title' / 'description' / 'color'Card field mapping: names (dotted paths reach nested objects) or getter functions. columnExpr holds the card's column key; a card with no resolvable column lands in the untitled column instead of being dropped.
orderExprstring | ((item: T) => unknown) | undefinedundefinedNumeric in-column sort order. Unset, the array order is the board order and moves reorder the working set; set, moves write a midpoint order value back onto the item (sequential renumber of the cell when the midpoint has no room).
swimlaneExprstring | ((item: T) => unknown) | undefinedundefinedSet = the board renders collapsible swimlane rows (first-seen data order); each lane holds every column.
tagsExpr / assigneeExprstring | ((item: T) => unknown) | undefinedundefinedTag chips and assignee avatars (initials). Both accept a single value or an array — write-back preserves the storage shape.
dueDateExpr / priorityExprstring | ((item: T) => unknown) | undefinedundefinedDue-date badge (danger when overdue; formatted through locale) and the priority indicator (colored by value: 'low' green, 'medium'/'normal' amber, 'high'/'urgent'/'critical' red).
searchExprsreadonly (string | ((item: T) => unknown))[] | undefinedundefinedExtra fields the toolbar search matches, beyond the built-in title + description + tags + assignees haystack. Matching is fold-insensitive (accents, Turkish İ/i).
columnsreadonly OgeKanbanColumn[] | undefinedundefinedDeclared columns ({ key, title?, color?, wipLimit?, minCount?, collapsed?, allowAdding?, allowDrag?, allowDrop?, transitionColumns? }); unset = derived from the data's distinct column keys in first-seen order. Cards in undeclared columns stay in the data but leave the view.

State (two-way)

Name Type DefaultDescription
collapsedColumns / collapsedSwimlanesmodel<readonly string[]>[]Collapsed column keys (slim vertical pills) and collapsed swimlane keys.
columnOrdermodel<readonly string[]>[]Persisted column key order (empty = declared order); written by header drags when allowColumnReordering is on.
selectedCardKeymodel<unknown>nullThe primary (focused / anchor) selected card's key. With selectionMode: 'multiple' the full set is selectedCardKeys.
selectedCardKeysmodel<readonly unknown[]>[]Every selected card key, in board order. Ctrl/⌘-click toggles, Shift-click selects the range in the anchor's column, Ctrl+A on a card selects its column (cell), Ctrl+Space toggles, Shift+↑/↓ extends and Escape collapses to the focused card. Selected cards travel together in a drag (the ghost shows the count), Ctrl+←/→ and Delete.
filterValuemodel<OgeKanbanFilterExpression>{}The filter chip bar's state — active tags / assignees / priorities. Bind it two-way to persist or preset the chips; it ANDs with filter and the toolbar search.
columnSortmodel<OgeKanbanColumnSort<T>>{}Per-column card sort: a column key (or '*' for every column) mapped to { field: 'order' | 'title' | 'priority' | 'dueDate', direction? } or a comparator over normalized cards. The column menu (the header's sort button or a right-click) writes it. Unset columns keep orderExpr / array order; a drop into a sorted column lands where the sort puts it.

Filtering, selection & transfers

Name Type DefaultDescription
filterOgeKanbanFilter<T> | undefinedundefinedProgrammatic card filter: a predicate over the normalized card, or an OgeKanbanFilterExpression ({ tags?, assignees?, priorities?, columns?, swimlanes?, text?, overdue? } — values inside a field are alternatives, fields combine with AND). Filters only what is shown: WIP counts, exports (unless visibleOnly) and the chips stay on the full data.
showFilterBarbooleanfalseShows the filter chip bar under the toolbar: one toggle chip (aria-pressed) per distinct tag, assignee and priority, plus a reset button.
priorityOrderreadonly string[] | undefinedundefinedPriority ranking for columnSort by priority, most important first (case-insensitive). Unset: urgent, critical, highest, high, medium, normal, low, lowest; numeric priorities compare as numbers.
selectionMode'single' | 'multiple''multiple''multiple' adds Ctrl/Shift-click, the selection shortcuts and multi-card drag; 'single' keeps one selected card.
dragGroup / boardIdstring | undefinedundefinedBoards sharing a dragGroup exchange cards: drag a card (or a selection) onto the other board, or use the card menu's “Move to …” entries — the keyboard and single-pointer twin. boardId names the board in the transfer events and the other boards' menus (a generated id otherwise).
swimlaneWipLimitsReadonly<Record<string, number>> | undefinedundefinedPer-lane total WIP limits keyed by swimlane value — the lane header's count turns danger when exceeded. Per-cell limits are OgeKanbanColumn.swimlaneWipLimit (the column inside each lane).
checklistExprstring | ((item: T) => unknown) | undefinedundefinedChecklist / sub-task field: an array of { text, done } (title / checked / completed and plain strings are read too). Cards show a progress badge with an ICU-plural screen-reader text; toggleChecklistItem() writes back in the entry's own shape.
quickAdd / inlineTitleEditingbooleanfalse / falsequickAdd: the column footer's add button opens an inline title composer (Enter adds and keeps it open, Escape closes) instead of the dialog. inlineTitleEditing: double-clicking a card title edits it in place; F2 on a card always does (both through cardAdding / cardUpdating).
undoLimitnumber50Undo/redo depth — Ctrl+Z / Ctrl+Y (or Ctrl+Shift+Z) and the toolbar buttons. Undo replays the inverse through the cancelable pipelines, so the -ing / -ed events fire as for the original edit; a multi-card move or bulk delete is one step. Cross-board transfers are not recorded (they span two boards). 0 disables history and hides the buttons.

Behavior

Name Type DefaultDescription
virtualScrollingbooleantruePer-column card windowing over a fixed cardHeight — 10k cards stay smooth. Rich variable-height templates may opt out (false), the documented exception.
cardHeightnumber | undefinedundefined (config: 112)Fixed card height in px; also drives the drag hit-testing and the keyboard scroll-into-view math.
showToolbarbooleantrueThe built-in toolbar: primary add button, collapse/expand-all pill and the search box.
allowAdding / allowUpdating / allowDeleting / allowDragging / allowColumnReordering / allowColumnAddingbooleantrue / true / true / true / false / falseCapability gates for the toolbar, dialog, menu, hover quick actions, keyboard shortcuts and drags. allowColumnAdding renders the "+ Add column" ghost column (inline composer → cancelable columnAdding → columnAdded). Per-column allowAdding: false overrides the board.
columnWidthnumber300Fixed column track width in px — headers stay legible and the board scrolls horizontally, Trello-style.
cardColorMode'stripe' | 'surface''stripe'How colorExpr renders: an accent bar on the card's edge, or the whole card surface tinted with the color.
rtlEnabledboolean | undefinedundefinedRight-to-left layout: the first column sits on the right, ArrowLeft/Right roving and Ctrl+Arrow card moves are mirrored (ArrowLeft goes to the next column), the column-reorder drag and drop hit-testing follow the mirrored geometry and the collapsed-lane chevron points left. Unset follows the page — the computed direction or the nearest dir attribute, read after the first render and kept current when a dir changes; an explicit value also sets dir on the host.
dialogItemsreadonly OgeFormItemData[] | undefinedundefinedReplaces the edit dialog's default form wholesale (generic OgeForm items); cardEditDialogShowing can still adjust per open. The default form only renders editors for fields the board actually maps.
readOnlybooleanfalseOne switch over every allow* capability; the context menu falls back to the browser's native menu.
messages / localePartial<OgeKanbanMessages> / string | undefined{} / undefinedPer-instance overrides of the DI config (provideOgeKanbanConfig). Every user-facing string, aria labels and live-region templates included, lives in the messages interface; locale drives every Intl format.

Methods 16

Methods

Name Type Description
addCard(item)(item: T) => voidProgrammatic insert through the cancelable cardAdding pipeline; the column and swimlane resolve from the item's own fields.
updateCard(original, updated)(original: T, updated: T) => voidProgrammatic update through the cancelable cardUpdating pipeline.
deleteCard(item)(item: T) => voidProgrammatic delete through the cancelable cardDeleting pipeline.
moveCard(key, toColumn, toIndex?, toSwimlane?)(key: unknown, toColumn: string, toIndex?: number, toSwimlane?: string | null) => voidMoves a card (append when toIndex is omitted) through the cancelable cardMoving pipeline — the same path the drag, the Ctrl+Arrow twin and the context menu commit through.
editCard(card) / openNewCard(column, swimlane)(…) => voidOpens the built-in dialog for an existing card / prefilled for a new card, through the cardEditDialogShowing hook.
closeDialog()() => voidCloses the edit dialog without saving; fires cardEditDialogHidden.
collapseAllColumns() / expandAllColumns()() => voidThe toolbar buttons, callable from code.
undo() / redo() / canUndo() / canRedo()() => void / () => booleanHistory: revert / re-apply the last step through the cancelable pipelines, and whether a step exists.
selectCards(keys) / clearSelection()(keys: readonly unknown[]) => void / () => voidProgrammatic selection (board order applied; writes selectedCardKeys).
moveCards(keys, toColumn, toIndex?, toSwimlane?)(keys: readonly unknown[], toColumn: string, toIndex?: number, toSwimlane?: string | null) => voidMoves several cards into one cell as one undoable step, inserted consecutively (board order kept) before the card at toIndex; without toSwimlane every card stays in its own lane. Each card runs cardMoving / cardMoved.
deleteCards(items)(items: readonly T[]) => voidBulk delete as one undoable step, each item through cardDeleting; announced with an ICU plural.
transferCards(keys, toBoard, toColumn?, toIndex?, toSwimlane?)(…) => booleanSends cards to another mounted board of the same dragGroup (default: its first droppable column, appended). Returns whether the target's cardTransferring accepted them.
toggleChecklistItem(key, index)(key: unknown, index: number) => voidToggles one checklist entry through cardUpdating (needs a field-name checklistExpr).
startTitleEdit(key)(key: unknown) => voidOpens the inline title editor on a card (what F2 does); Enter or blur commits through cardUpdating, Escape cancels.
clearFilters()() => voidResets the chip bar (filterValue); the programmatic filter input is untouched.
getExportData(options?) / exportToCsv(fileName?, options?)(options?: OgeKanbanExportOptions) => OgeKanbanExportData / (fileName?: string, options?: OgeKanbanExportOptions) => stringThe cards as export rows in board order (column → lane → cell; visibleOnly keeps only what the filters show), and a CSV download built on core's formula-guarded buildCsv (returns the text). Excel is the lazy @oge-ui/kanban/export-excel entry.

Events 9

Events

Name Type Description
cardClick / cardDblClick / cardContextMenuOgeKanbanCardEvent<T>Pointer interactions with a card ({ card, event }). Double-click also opens the editor; right-click fires before the built-in menu opens, so app handlers can coexist with it.
cardAdding / cardUpdating / cardDeleting / cardMovingOge…Event<T> (mutable cancel)Cancelable pre-events — set cancel = true to veto. cardMoving carries { card, fromColumn, toColumn, fromIndex, toIndex, fromSwimlane, toSwimlane } and guards drags, keyboard moves and programmatic moves alike.
cardAdded / cardUpdated / cardDeleted / cardMovedOge…Event<T>Past-tense events fire only for applied changes and carry the data to persist (cardMoved.card is the updated item, orderExpr write-back included).
cardEditDialogShowingOgeKanbanEditDialogShowingEvent<T>Cancelable + customization point before the dialog opens: formItems arrives pre-populated with the default OgeForm items and may be mutated or replaced (dx onAppointmentFormOpening parity).
cardEditDialogHiddenvoidThe edit dialog closed — saved, cancelled, deleted or closeDialog() (Syncfusion dialogClose parity).
columnReorderedOgeKanbanColumnReorderedEventA header drag committed a new order: { column, fromIndex, toIndex, columnOrder }.
columnAdding / columnAddedOgeKanbanColumnAddingEvent / OgeKanbanColumnAddedEventThe "+ Add column" composer's cancelable pre-event and its past-tense commit.
cardTransferringOgeKanbanCardTransferringEvent<T>Cancelable, fired by the target board before cards from another board of the dragGroup land: { cards, fromBoard, toBoard, fromColumn, toColumn, fromSwimlane, toSwimlane, toIndex, cancel }.
cardTransferredOgeKanbanCardTransferredEvent<T>Fired by both boards after a transfer landed: the source host removes sourceCards from its data, the target host adds cards (column / swimlane already written).

Types 21

Templates

Name Type Description
*ogeKanbanCardTemplateOgeKanbanCardTemplateContext<T>Replaces the card body ($implicit card with its source, plus column and swimlane). Drag, keyboard and ARIA stay on the component. Buttons, links and inputs in the template are real interactive content: Tab reaches them while the card is its column's tab stop, they never start a drag or feed the board's arrow keys, and Escape returns to the card.
*ogeKanbanColumnHeaderTemplateOgeKanbanColumnHeaderTemplateContextReplaces the column header's title row ($implicit column, count, wip); the collapse affordance stays. An OGE extra — no reference library templates its headers.

Configuration

Name Type Description
provideOgeKanbanConfig(config)(config: OgeKanbanConfigInput) => ProviderDI-level configuration: messages (shallow-merged per top-level block), locale, cardHeight.
OgeKanbanMessagesinterfaceEvery user-facing string: toolbar, menu, dialog, board (aria label templates with {title}/{count}/{limit} tokens) and announcements (live-region templates).
OgeKanbanBoardMessagesinterfaceThe board block: boardLabel, columnLabel / columnLabelWip (the column list's name), cardLabel ({title}, {column}), cardRoleDescription (default card — every card's aria-roledescription), editCardAction / deleteCardAction (the quick-action buttons, {title}), boardHint, wipExceeded, overdue, the empty-state and add-card/column strings.
OgeKanbanColumninterface{ key, title?, color?, wipLimit?, minCount?, collapsed?, allowAdding?, allowDrag?, allowDrop?, transitionColumns? } — the declared column shape. wipLimit/minCount drive the danger/warning badges; allowDrag/allowDrop/transitionColumns gate interactive moves (programmatic moveCard is deliberately not gated).
OgeKanbanCard<T>interfaceThe normalized card handed to templates and events: key, source (your item, unchanged), column, title, description, color, order, swimlane, tags, assignees, dueDate, priority, checklist ({ text, done }[]).

Filtering, sorting & selection types

Name Type Description
OgeKanbanFilter<T>type((card: OgeKanbanCard<T>) => boolean) | OgeKanbanFilterExpression — the filter input's shape.
OgeKanbanFilterExpressioninterface{ tags?, assignees?, priorities?, columns?, swimlanes?, text?, overdue? } — any-of inside a field, all-of across fields; also the chip bar's filterValue.
OgeKanbanColumnSort<T>typeReadonly<Record<string, OgeKanbanColumnSortSpec<T>>> keyed by column ('*' = every column).
OgeKanbanColumnSortSpec<T>type{ field: OgeKanbanSortField; direction?: 'asc' | 'desc' } or a card comparator (ties fall back to the board order).
OgeKanbanSortField'order' | 'title' | 'priority' | 'dueDate'Sort fields; ascending priority puts the most important first, empty due dates sort last in both directions.
OgeKanbanSelectionMode'single' | 'multiple'The selectionMode union.
OgeKanbanCardTransferringEvent<T> / OgeKanbanCardTransferredEvent<T>interfaceCross-board transfer payloads: board ids, from/to column and lane, insertion index; the past-tense one carries both cards (as landed) and sourceCards.

Export

Name Type Description
OgeKanbanExportDatainterface{ rows, messages, locale, hasSwimlanes } — what getExportData() returns and both exporters read.
OgeKanbanExportRowinterface{ key, title, column, columnKey, swimlane, description, tags, assignees, priority, dueDate, checklistDone, checklistTotal }.
OgeKanbanExportOptionsinterface{ visibleOnly? } — only the cards the filters and search show.
OgeKanbanExportMessagesinterfaceThe optional export messages block: sheetName and every column header (English fallback when a catalog omits it).
exportKanbanToExcel(board, options?)(board, options?: OgeKanbanExcelExportOptions) => Promise<void>The lazy /export-excel entry (optional exceljs peer): one row per card, due dates as real dates, tags/assignees joined with ; . Pass the board instance (Angular) or its ref handle (React).
buildKanbanExcelWorkbook(data, options?)(data: OgeKanbanExportData, options?) => WorkbookThe pure builder behind it, shared by both layers through @oge-ui/kanban-engine/export-excel.
OgeKanbanExcelExportOptionsinterface{ filename?, sheetName?, visibleOnly? } (defaults kanban.xlsx / the export.sheetName message).

Notes

  • No WAI-ARIA APG kanban pattern exists, and a listbox cannot hold interactive content, so the board is a set of lists with a roving focus: each column is a labeled role="list" (title, count and WIP limit in the accessible name) of role="listitem" wrappers, each holding a focusable card (role="group", aria-roledescription="card" from messages.board.cardRoleDescription, the selected card aria-current). One Tab stop per column.
  • Keyboard on a focused card: Arrow keys rove within and across columns, Enter edits, Delete deletes, Ctrl+Arrow moves the card as the exact keyboard twin of the drag (announced through a polite live region), and Tab continues into the card's own content — the edit / delete quick actions are real labeled buttons, and so is whatever a custom card template renders. Keys typed there stay with that control (Ctrl+Arrow in an input moves by word, not the card); Escape returns to the card.
  • Binding plain arrays never mutates them — edits land in an internal working set and the past-tense events carry the data to persist. Without an orderExpr the array order is the board order; with one, moves write a midpoint order value back in the item's own storage shape.
  • Virtualization assumes the fixed cardHeight — that is also what keeps drag hit-testing allocation-free and agreeing with what is rendered. Rich variable-height card templates should set [virtualScrolling]="false" (the documented exception).