DataTable

A full-featured, column-definition driven data table with client-side sorting, row selection with indeterminate header checkbox, and pagination.

Installation

npx dafink-ui add data-table

Demo

Paginator:
Status
Alice ChenEngineerPlatformActive2022-03-14$145,000
Bob RuizDesignerProductAway2021-07-01$130,000
Carol SmithEngineering MgrPlatformActive2020-01-20$165,000
Dave ParkData AnalystAnalyticsActive2023-05-10$120,000
Eve TorresDesignerProductActive2022-11-03$128,000
Showing 15 of 12

Props

NameTypeDefaultDescription
dataT[]-Array of data objects to display.
columnsColumnDef<T>[]-Column definitions controlling headers, keys, sorting, and cell rendering.
keyFieldkeyof T & string-Property key used as a unique row identifier.
selectablebooleanfalsePrepends a checkbox column for row selection.
onSelectionChange(selected: T[]) => voidundefinedCalled with selected rows whenever selection changes.
pageSizenumber10Rows per page. Set to 0 to show all rows.
emptyMessagestring'No data'Text shown when data is empty.
classNamestring''Additional classes on the root wrapper.