# KanbanProps (@salmonui/kanban)

> The KanbanProps interface of @salmonui/kanban.

Canonical: https://salmonui.dev/docs/reference/kanban/KanbanProps

```ts
import type { KanbanProps } from '@salmonui/kanban';
```

Entry index: https://salmonui.dev/docs/reference/kanban (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/kanban.md).

## Reference

Kind: interface

```ts
interface KanbanProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange' | 'defaultValue'> {
    readonly data: readonly T[] | KanbanDataSource<T>;
    readonly getCardId: (card: T) => KanbanKey;
    readonly columnField: string;
    readonly columns?: readonly KanbanColumnDef[] | undefined;
    readonly children?: ReactNode;
    readonly showEmptyColumns?: boolean | undefined;
    readonly collapsedColumns?: readonly KanbanKey[] | undefined;
    readonly defaultCollapsedColumns?: readonly KanbanKey[] | undefined;
    readonly onCollapsedColumnsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined;
    readonly limitScope?: 'column' | 'swimlane' | undefined;
    readonly columnGroups?: readonly KanbanColumnGroup[] | undefined;
    readonly swimlanes?: KanbanSwimlanes | undefined;
    readonly card?: KanbanCardFields | undefined;
    readonly renderCard?: ((ctx: KanbanCardContext<T>) => ReactNode) | undefined;
    readonly cardHeight?: number | 'auto' | undefined;
    readonly getCardProps?: ((ctx: KanbanCardContext<T>) => KanbanCardProps | undefined) | undefined;
    readonly selection?: 'none' | 'single' | 'multiple' | undefined;
    readonly selectedCards?: readonly KanbanKey[] | undefined;
    readonly defaultSelectedCards?: readonly KanbanKey[] | undefined;
    readonly onSelectedCardsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined;
    readonly sort?: KanbanSort<T> | undefined;
    readonly filter?: ((card: T) => boolean) | undefined;
    readonly query?: KanbanQuery | undefined;
    readonly loading?: boolean | undefined;
    readonly cardsDraggable?: boolean | undefined;
    readonly onCardMove?: ((event: KanbanCardMoveEvent<T>) => void) | undefined;
    readonly dragGroup?: string | undefined;
    readonly dropTargets?: readonly KanbanDropTarget<T>[] | undefined;
    readonly columnsReorderable?: boolean | undefined;
    readonly columnOrder?: readonly KanbanKey[] | undefined;
    readonly defaultColumnOrder?: readonly KanbanKey[] | undefined;
    readonly onColumnOrderChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) | undefined;
    readonly onCardChange?: ((event: KanbanCardChangeEvent<T>) => void) | undefined;
    readonly onCardAdd?: ((event: KanbanCardAddEvent) => void) | undefined;
    readonly newCard?: ((at: KanbanCellRef) => T) | undefined;
    readonly editor?: boolean | {
        readonly fields: readonly KanbanEditorField<T>[];
    } | undefined;
    readonly renderEditor?: ((ctx: KanbanEditorContext<T>) => ReactNode) | undefined;
    readonly editing?: KanbanEditing | undefined;
    readonly defaultEditing?: KanbanEditing | undefined;
    readonly onEditingChange?: ((value: KanbanEditing, details: KanbanChangeDetails) => void) | undefined;
    readonly tooltip?: boolean | KanbanTooltip<T> | undefined;
    readonly virtualization?: boolean | undefined;
    readonly height?: number | string | undefined;
    readonly onCardClick?: ((event: KanbanCardClickEvent<T>) => void) | undefined;
    readonly onCardDoubleClick?: ((event: KanbanCardClickEvent<T>) => void) | undefined;
    readonly onDataError?: ((error: unknown, kind: 'read' | 'write') => void) | undefined;
    readonly localeText?: Partial<KanbanLocaleText> | undefined;
    readonly ref?: Ref<KanbanApi> | undefined;
}
```

Members (48):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly T[] \| KanbanDataSource<T>;` |  | Cards (an array, copied for built-in writes), or a `@salmonui/data` source. A new array resets the board's copy. |
| `getCardId` | `readonly getCardId: (card: T) => KanbanKey;` |  |  |
| `columnField` | `readonly columnField: string;` |  | Card field that holds the column key. |
| `columns` | `readonly columns?: readonly KanbanColumnDef[] \| undefined;` | optional |  |
| `children` | `readonly children?: ReactNode;` | optional | `KanbanColumn` elements: the declarative alternative to `columns`. |
| `showEmptyColumns` | `readonly showEmptyColumns?: boolean \| undefined;` | optional | Shows columns without cards (default true). |
| `collapsedColumns` | `readonly collapsedColumns?: readonly KanbanKey[] \| undefined;` | optional |  |
| `defaultCollapsedColumns` | `readonly defaultCollapsedColumns?: readonly KanbanKey[] \| undefined;` | optional |  |
| `onCollapsedColumnsChange` | `readonly onCollapsedColumnsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) \| undefined;` | optional |  |
| `limitScope` | `readonly limitScope?: 'column' \| 'swimlane' \| undefined;` | optional | WIP limits count per column (default) or per swimlane cell. |
| `columnGroups` | `readonly columnGroups?: readonly KanbanColumnGroup[] \| undefined;` | optional |  |
| `swimlanes` | `readonly swimlanes?: KanbanSwimlanes \| undefined;` | optional |  |
| `card` | `readonly card?: KanbanCardFields \| undefined;` | optional |  |
| `renderCard` | `readonly renderCard?: ((ctx: KanbanCardContext<T>) => ReactNode) \| undefined;` | optional | Replaces the card body. Pure; called for rendered cards only. |
| `cardHeight` | `readonly cardHeight?: number \| 'auto' \| undefined;` | optional | Fixed card height in px, or `'auto'` (default) for measured heights. |
| `getCardProps` | `readonly getCardProps?: ((ctx: KanbanCardContext<T>) => KanbanCardProps \| undefined) \| undefined;` | optional |  |
| `selection` | `readonly selection?: 'none' \| 'single' \| 'multiple' \| undefined;` | optional | Default `'single'`. |
| `selectedCards` | `readonly selectedCards?: readonly KanbanKey[] \| undefined;` | optional |  |
| `defaultSelectedCards` | `readonly defaultSelectedCards?: readonly KanbanKey[] \| undefined;` | optional |  |
| `onSelectedCardsChange` | `readonly onSelectedCardsChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) \| undefined;` | optional |  |
| `sort` | `readonly sort?: KanbanSort<T> \| undefined;` | optional |  |
| `filter` | `readonly filter?: ((card: T) => boolean) \| undefined;` | optional | Client-side card filter (pure). |
| `query` | `readonly query?: KanbanQuery \| undefined;` | optional | Base query of source reads; a new identity re-reads, so memoize it (as `data` for a source). |
| `loading` | `readonly loading?: boolean \| undefined;` | optional | Forces the loading state. |
| `cardsDraggable` | `readonly cardsDraggable?: boolean \| undefined;` | optional | Enables pointer and keyboard card drag. |
| `onCardMove` | `readonly onCardMove?: ((event: KanbanCardMoveEvent<T>) => void) \| undefined;` | optional |  |
| `dragGroup` | `readonly dragGroup?: string \| undefined;` | optional | Boards with the same group accept each other's cards. |
| `dropTargets` | `readonly dropTargets?: readonly KanbanDropTarget<T>[] \| undefined;` | optional |  |
| `columnsReorderable` | `readonly columnsReorderable?: boolean \| undefined;` | optional | Enables column reorder by pointer and Alt+Arrow keys. |
| `columnOrder` | `readonly columnOrder?: readonly KanbanKey[] \| undefined;` | optional |  |
| `defaultColumnOrder` | `readonly defaultColumnOrder?: readonly KanbanKey[] \| undefined;` | optional |  |
| `onColumnOrderChange` | `readonly onColumnOrderChange?: ((value: readonly KanbanKey[], details: KanbanChangeDetails) => void) \| undefined;` | optional |  |
| `onCardChange` | `readonly onCardChange?: ((event: KanbanCardChangeEvent<T>) => void) \| undefined;` | optional |  |
| `onCardAdd` | `readonly onCardAdd?: ((event: KanbanCardAddEvent) => void) \| undefined;` | optional |  |
| `newCard` | `readonly newCard?: ((at: KanbanCellRef) => T) \| undefined;` | optional | Draft of a new card in a cell (default: `{ id: 'new-<n>', [columnField], [swimlanes.field] }`); called once when the editor opens for a new card, never during render. |
| `editor` | `readonly editor?: boolean \| {     readonly fields: readonly KanbanEditorField<T>[]; } \| undefined;` | optional | Built-in editor: `true` edits the card fields, or a field list. |
| `renderEditor` | `readonly renderEditor?: ((ctx: KanbanEditorContext<T>) => ReactNode) \| undefined;` | optional |  |
| `editing` | `readonly editing?: KanbanEditing \| undefined;` | optional |  |
| `defaultEditing` | `readonly defaultEditing?: KanbanEditing \| undefined;` | optional |  |
| `onEditingChange` | `readonly onEditingChange?: ((value: KanbanEditing, details: KanbanChangeDetails) => void) \| undefined;` | optional |  |
| `tooltip` | `readonly tooltip?: boolean \| KanbanTooltip<T> \| undefined;` | optional |  |
| `virtualization` | `readonly virtualization?: boolean \| undefined;` | optional | Per-column card virtualization; ignored with swimlanes. |
| `height` | `readonly height?: number \| string \| undefined;` | optional | Board height (px or CSS length); columns scroll inside it. |
| `onCardClick` | `readonly onCardClick?: ((event: KanbanCardClickEvent<T>) => void) \| undefined;` | optional |  |
| `onCardDoubleClick` | `readonly onCardDoubleClick?: ((event: KanbanCardClickEvent<T>) => void) \| undefined;` | optional | Default action: opens the editor (with `editor`). |
| `onDataError` | `readonly onDataError?: ((error: unknown, kind: 'read' \| 'write') => void) \| undefined;` | optional | Read and write failures of a source (`writeError` reverts the optimistic change). |
| `localeText` | `readonly localeText?: Partial<KanbanLocaleText> \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<KanbanApi> \| undefined;` | optional |  |
