DataTable
A semantic table with filtering, sorting and pagination.
Interactive preview
| Orbit workspace | 12 | |
| Field notes | 4 |
4 records
Usage
import { DataTable } from "@devvy-ui/react";
<DataTable label="Projects" rows={rows} columns={columns} getRowId={row => row.id} filterText={row => row.name} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| rows / columns | T[] / DataColumn<T>[] | required | Records and typed cell renderers. |
| getRowId | (row: T) => string | required | Stable identity. |
| filterText | (row: T) => string | — | Enables text filtering. |
| pageSize | number | 10 | Visible records per page. |
| rowSelection | DataTableSelection<T> | — | Workspace addition: getRowLabel, selectedIds/defaultSelectedIds, onSelectedIdsChange, isRowSelectable and renderActions(rows, clear). Omit for the existing table behavior. |
Accessibility & behavior
Platform Behavior & Guidelines
Typed renderers preserve native table structure. Sortable columns supply sortValue; row ids must be stable. Filtering and pagination remain client side; use bounded datasets. Optional rowSelection is available since npm 0.3.0. Select-all affects eligible rows on the current page; selection persists across filtering and pages. Bulk actions receive only existing, selectable rows.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add data-tableMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.