Ship-It Designv0.0.3
GitHub

DataTable

Each example below is a real component instance — flip the theme toggle to see how it adapts.

Sortable#

Loading…

Selectable#

Loading…

Props#

Props for DataTable
PropTypeDefaultDescription
data *readonly T[]
columns *readonly DataTableColumn<T>[]
rowKey *(row: T) => stringReturns a stable id for `row`. Required for selection + React keys.
sortDataTableSort | null | undefinedControlled sort state.
defaultSortDataTableSort | null | undefined
onSortChange((sort: DataTableSort | null) => void) | undefined
selectableboolean | undefinedShow the leading checkbox column.
selectedReadonlySet<string> | undefinedControlled selection.
defaultSelectedreadonly string[] | undefined
onSelectionChange((selection: ReadonlySet<string>) => void) | undefined
emptyStateReactNodeRendered when `data` is empty.
stickyHeaderboolean | undefinedSticky table header (requires the table to live in a scroll container).
captionReactNodeCaption for screen readers.
classNamestring | undefined
refRef<HTMLTableElement> | undefined