API reference
Props
The component accepts four required props and seven optional styling and layout props.
Required props
These four props define the board.
The board never mutates your data
columnData is treated as read-only. Moving an item is your responsibility inside onDragEnd.Layout props
Control how wide columns are and how the board sits in its parent.
Style props
All styles are React Native ViewStyle objects.
Full reference
The complete TypeScript interface, copied from src/types.ts.
types.ts
export type columnDataType<T, K> = {
header: K;
items: T[];
};
export type ItemType = { id: string };
export type HeaderParams = {
title: string;
subtitle?: string;
};
export interface DraggedCardProps<T> {
id: string;
y: number;
x: number;
width: number;
props: T;
columnIndex: number;
}
export interface KanbanBoardProps<T extends ItemType, K> {
columnData: columnDataType<T, K>[];
renderItem: (props: T, isDragged?: boolean) => JSX.Element;
renderHeader: (props: K) => JSX.Element;
onDragEnd: (params: {
fromColumnIndex: number;
toColumnIndex: number;
itemId: string;
}) => void;
containerStyle?: ViewStyle;
contentContainerStyle?: ViewStyle;
columnHeaderStyle?: ViewStyle;
columnContainerStyle?: ViewStyle;
columnContainerStyleOnDrag?: ViewStyle;
columnWidth?: number;
gapBetweenColumns?: number;
}4required props
7optional props
2generics
1drag callback