ui-kit0.0

Data

Data table

Sort, filter, select and paginate rows.

Payments

Forty payments with sortable headers, debounced search, row selection with a floating bulk-action bar, a columns menu, page size and “Showing 1–10 of 40”. State is uncontrolled here.

Actions
Amara Okaforamara.okafor@example.com
PaidVisaNov 28, 2025$12.00
Liam Brennanliam.brennan@example.com
PaidMastercardNov 27, 2025$91.19
Sofia Marchettisofia.marchetti@example.com
RefundedBank transferNov 26, 2025$170.38
Noah Fischernoah.fischer@example.com
PaidPayPalNov 25, 2025$249.57
Yuki Tanakayuki.tanaka@example.com
FailedVisaNov 24, 2025$328.76
Priya Ramanpriya.raman@example.com
PendingMastercardNov 23, 2025$407.95
Mateo Alvarezmateo.alvarez@example.com
PendingBank transferNov 22, 2025$487.14
Elena Petrovaelena.petrova@example.com
PaidPayPalNov 21, 2025$566.33
Jonas Lindqvistjonas.lindqvist@example.com
PaidVisaNov 20, 2025$645.52
Hana Kimhana.kim@example.com
PaidMastercardNov 19, 2025$724.71

Showing 1–10 of 40

Page 1 of 4
40 payments, sorted by Date descending

When to use

  • Lists people scan, compare and act on: payments, users, orders, logs.
  • A static, read-only grid needs no state: use Table directly.
  • Server-side data: control page, sort, search and filters and feed the table the page you fetched (the helpers only operate on what you pass in).

Controlled state, filters and loading

Search, sort, per-column filters and the page are held by the parent. The role column renders a select in the filter row; loading swaps rows for skeletons without changing the layout.

Sorted by seats (desc), page 1
Priya RamanAdminSupport14
Amara OkaforOwnerPlatform12
Yuki TanakaEditorPlatform9
Liam BrennanAdminGrowth8
Elena PetrovaEditorDesign6

Showing 1–5 of 8

Page 1 of 2
8 members, sorted by Seats descending

API

DataTable

PropTypeDefaultDescription
columnsDataTableColumn<T>[]—Column definitions (see below).
datareadonly T[]—The rows.
getRowId(row, index) => string—Stable id per row. Default: row.id, else the index.
label / caption / rowLabelstring / ReactNode / string—Table name, visible caption, and the noun used in counts ("payment").
striped, compact, bordered, stickyHeader, maxHeightTable props—Passed to Table.
searchablebooleantrueGlobal search field.
search / defaultSearch / onSearchChangestring—Controlled or uncontrolled query. Applied after searchDebounce (200ms).
sort / defaultSort / onSortChangeDataTableSort | null—{ id, direction: "asc" | "desc" } or null.
columnFilters / defaultColumnFilters / onColumnFiltersChangeRecord<string, string>—Per-column filter values.
selectablebooleanfalseCheckbox column.
selectedRowIds / defaultSelectedRowIds / onSelectedRowIdsChangestring[]—Selection, persists across pages.
bulkActions({ selectedRows, selectedIds, clearSelection }) => ReactNode—Content of the floating bar.
paginatedbooleantruePaginate rows.
page / defaultPage / onPageChangenumber—1-based page.
pageSize / defaultPageSize / onPageSizeChangenumber10Rows per page.
pageSizeOptionsnumber[][10, 25, 50]Choices in the rows-per-page select.
columnsMenubooleantrueColumns visibility menu.
columnVisibility / defaultColumnVisibility / onColumnVisibilityChangeRecord<string, boolean>—Visibility by column id.
loadingbooleanfalseSkeleton rows, aria-busy.
emptyStateReactNode—Replaces the default "No results" content.
toolbarReactNode—Extra controls before the Columns menu.

DataTableColumn

PropTypeDefaultDescription
idstring—Unique, stable.
headerReactNode—Header content.
labelstring—Plain name for the columns menu (defaults to a string header).
accessorkeyof T | (row) => unknown—Value for display, sort, search and filter.
cell({ row, value, index, rowId }) => ReactNode—Custom cell.
sortable / compareboolean / (a, b) => number—Sort button and optional comparator.
searchable / searchTextboolean / (row) => string—Global search participation and text.
filter / filterFn(ctx) => ReactNode / (row, value) => boolean—Filter-row control and predicate.
align, width, hidden, hideablemisc—Layout and visibility.

The pure helpers are exported too: dataTableFilterRows, dataTableSortRows, dataTablePaginate, dataTableCompareValues and dataTableNextDirection.

Keyboard

KeyAction
TabMoves through search, columns menu, sort buttons, checkboxes, row actions and the pager.
Enter / SpaceActivates a sort button, toggles a checkbox, presses prev / next.
EscIn the search field, clears it. In the columns menu, closes it.
Arrow keysMove between items in the columns menu.

Accessibility

  • Native table; sortable headers expose aria-sort and contain a real button.
  • Every checkbox has a name (“Select all rows on this page”, or selectRowLabel).
  • A polite live region announces the result count and sort after changes; loading sets aria-busy.
  • Selection is never colour alone: the checkbox is checked and the footer counts it.

Motion

  • The bulk bar rises in (380ms soft rise) and exits faster (160ms). The sort arrow and empty state pop in.
  • Reduced motion keeps every state change and drops the movement.