Skip to content

DataTableProps

DataTableProps<T> = object

Defined in: packages/ui/src/types.ts:506

Props for the DataTable component.

Renders a sortable, selectable data table with permission-aware row actions. Integrates with @cfast/pagination for data, @cfast/db for column inference, @cfast/permissions for action visibility, and @cfast/actions for row-level operations.

T = unknown

The row object type for type-safe column rendering and selection callbacks.

optional actions: ClientDescriptor

Defined in: packages/ui/src/types.ts:519

Action descriptor for row-level actions.


optional columns: ColumnShorthand<T>[]

Defined in: packages/ui/src/types.ts:517

Column definitions or key strings.


data: object

Defined in: packages/ui/src/types.ts:508

Paginated data including items and loading state.

optional isLoading: boolean

Whether data is currently being fetched.

items: T[]

Array of row objects to display.


optional emptyMessage: string

Defined in: packages/ui/src/types.ts:531

Message shown when there are no items.


optional getRowId: (row) => string | number

Defined in: packages/ui/src/types.ts:529

Function to extract a unique ID from a row. Defaults to row.id.

T

string | number


optional onRowClick: (row) => void

Defined in: packages/ui/src/types.ts:527

Callback when a row is clicked.

T

void


optional onSelectionChange: (rows) => void

Defined in: packages/ui/src/types.ts:525

Callback when row selection changes.

T[]

void


optional selectable: boolean

Defined in: packages/ui/src/types.ts:521

Whether to show row selection checkboxes.


optional selectedRows: T[]

Defined in: packages/ui/src/types.ts:523

Externally controlled selected rows.


optional table: unknown

Defined in: packages/ui/src/types.ts:515

Drizzle table for column type inference.