DataTable
moleculeFeature-rich table with sortable columns, pagination, and a custom empty state. Accepts typed row data via generics.
Basic table
Sortable columns with pagination.
Empty state
Custom message when there are no rows.
Usage
Installation
API Reference
DataTable props — * required
| Prop | Type | Default | Description |
|---|---|---|---|
columns* | DataTableColumn<T>[] | — | Column definitions with key, header, optional render, sortable, width, and align. |
rows* | T[] | — | Array of row data objects. |
pageSize | number | 10 | Number of rows per page. |
page | number | — | Controlled current page (1-indexed). |
onPageChange | (page: number) => void | — | Called when the user changes the page. |
emptyState | React.ReactNode | — | Content rendered when rows is empty. |
style | React.CSSProperties | — | Inline styles for the table wrapper. |