API reference: @salmonui/kanban
Kanbancomponent
import { Kanban } from '@salmonui/kanban';function Kanban<T>(props: KanbanProps<T>): ReactNode;
The Kanban board.
Props: KanbanProps
| Name | Signature | Description |
|---|---|---|
data | readonly data: readonly T[] | KanbanDataSource<T>; | Cards (an array, copied for built-in writes), or a |
getCardId | readonly getCardId: (card: T) => KanbanKey; | |
columnField | readonly columnField: string; | Card field that holds the column key. |
columnsoptional | readonly columns?: readonly KanbanColumnDef[] | undefined; | |
childrenoptional | readonly children?: ReactNode; |
|
showEmptyColumnsoptional | readonly showEmptyColumns?: boolean | undefined; | Shows columns without cards (default true). |
collapsedColumnsoptional | readonly collapsedColumns?: readonly KanbanKey[] | undefined; | |
defaultCollapsedColumnsoptional | readonly defaultCollapsedColumns?: readonly KanbanKey[] | undefined; | |
onCollapsedColumnsChangeoptional | readonly onCollapsedColumnsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined; | |
limitScopeoptional | readonly limitScope?: 'column' | 'swimlane' | undefined; | WIP limits count per column (default) or per swimlane cell. |
columnGroupsoptional | readonly columnGroups?: readonly KanbanColumnGroup[] | undefined; | |
swimlanesoptional | readonly swimlanes?: KanbanSwimlanes | undefined; | |
cardoptional | readonly card?: KanbanCardFields | undefined; | |
renderCardoptional | readonly renderCard?: ((ctx: KanbanCardContext<T>) => ReactNode) | undefined; | Replaces the card body. Pure; called for rendered cards only. |
cardHeightoptional | readonly cardHeight?: number | 'auto' | undefined; | Fixed card height in px, or |
getCardPropsoptional | readonly getCardProps?: ((ctx: KanbanCardContext<T>) => KanbanCardProps | undefined) | undefined; | |
selectionoptional | readonly selection?: 'none' | 'single' | 'multiple' | undefined; | Default |
selectedCardsoptional | readonly selectedCards?: readonly KanbanKey[] | undefined; | |
defaultSelectedCardsoptional | readonly defaultSelectedCards?: readonly KanbanKey[] | undefined; | |
onSelectedCardsChangeoptional | readonly onSelectedCardsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined; | |
sortoptional | readonly sort?: KanbanSort<T> | undefined; | |
filteroptional | readonly filter?: ((card: T) => boolean) | undefined; | Client-side card filter (pure). |
queryoptional | readonly query?: KanbanQuery | undefined; | Base query of source reads; a new identity re-reads, so memoize it (as |
loadingoptional | readonly loading?: boolean | undefined; | Forces the loading state. |
cardsDraggableoptional | readonly cardsDraggable?: boolean | undefined; | Enables pointer and keyboard card drag. |
onCardMoveoptional | readonly onCardMove?: ((event: KanbanCardMoveEvent<T>) => void) | undefined; | |
dragGroupoptional | readonly dragGroup?: string | undefined; | Boards with the same group accept each other's cards. |
dropTargetsoptional | readonly dropTargets?: readonly KanbanDropTarget<T>[] | undefined; | |
columnsReorderableoptional | readonly columnsReorderable?: boolean | undefined; | Enables column reorder by pointer and Alt+Arrow keys. |
columnOrderoptional | readonly columnOrder?: readonly KanbanKey[] | undefined; | |
defaultColumnOrderoptional | readonly defaultColumnOrder?: readonly KanbanKey[] | undefined; | |
onColumnOrderChangeoptional | readonly onColumnOrderChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined; | |
onCardChangeoptional | readonly onCardChange?: ((event: KanbanCardChangeEvent<T>) => void) | undefined; | |
onCardAddoptional | readonly onCardAdd?: ((event: KanbanCardAddEvent) => void) | undefined; | |
newCardoptional | readonly newCard?: ((at: KanbanCellRef) => T) | undefined; | Draft of a new card in a cell (default: |
editoroptional | readonly editor?: boolean | {
readonly fields: readonly KanbanEditorField<T>[];
} | undefined; | Built-in editor: |
renderEditoroptional | readonly renderEditor?: ((ctx: KanbanEditorContext<T>) => ReactNode) | undefined; | |
editingoptional | readonly editing?: KanbanEditing | undefined; | |
defaultEditingoptional | readonly defaultEditing?: KanbanEditing | undefined; | |
onEditingChangeoptional | readonly onEditingChange?: ((value: KanbanEditing, details: KanbanChangeDetails) => void) | undefined; | |
tooltipoptional | readonly tooltip?: boolean | KanbanTooltip<T> | undefined; | |
virtualizationoptional | readonly virtualization?: boolean | undefined; | Per-column card virtualization; ignored with swimlanes. |
heightoptional | readonly height?: number | string | undefined; | Board height (px or CSS length); columns scroll inside it. |
onCardClickoptional | readonly onCardClick?: ((event: KanbanCardClickEvent<T>) => void) | undefined; | |
onCardDoubleClickoptional | readonly onCardDoubleClick?: ((event: KanbanCardClickEvent<T>) => void) | undefined; | Default action: opens the editor (with |
onDataErroroptional | readonly onDataError?: ((error: unknown, kind: 'read' | 'write') => void) | undefined; | Read and write failures of a source ( |
localeTextoptional | readonly localeText?: Partial<KanbanLocaleText> | undefined; | |
refoptional | readonly ref?: Ref<KanbanApi> | undefined; |