Skip to content

Data Table

Free

Shows a list of records that people can search, filter, sort, select, and page through. It has a loading, empty, and error state of its own.

  • React 19
  • Tailwind CSS 4

Added Nov 11, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Make the table with useTable, and pass it to the root. Add data-table-toolbar for search and filters, and data-table-pagination for the footer.

The sample also uses data-table-pagination and data-table-toolbar. One command adds them with this item:

customers-table.tsx

DataTable

<div>
PropTypeDefaultDescription
size"default""sm"—
tableRequiredReactTable<TFeatures, TData, TSelected>—The table from useTable, with dataTableFeatures (or a preset that adds to it).
childrenReactNode—
status"empty""error""loading""ready""ready"The load state of the rows. Default ready. loading: the first load, skeleton rows at the real row height, and aria-busy. empty: the body shows its no rows state. error: the rows did not load. With no rows the body shows the error state; with rows on screen (a refresh failed) the rows stay and one line above them says so.
refreshingbooleanfalseNew data loads while the old rows stay: a 2px line under the head, and aria-busy.
onRetry—Load the rows again: the Retry button of the error states. Without it, no button. Keep it stable.
density"comfortable""compact""default"—The row height (controlled).
defaultDensity"comfortable""compact""default""default"The row height on the first render (uncontrolled). Default default (36px).
onDensityChange—
labels—The words of the table, over the English defaults (DATA_TABLE_LABELS). Keep it stable.
localestring—The locale of the counts. Default: the page locale.
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableSelectAll

<span>
PropTypeDefaultDescription
classNamestring—
size"default""lg"—default 16px, or lg 20px. Default: the CheckboxGroup size, else default.
From Base UICheckbox.RootBase UI docs
idstring—The id of the input element.
namestringundefinedIdentifies the field when a form is submitted.
formstring—Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

DataTableSelectRow

<span>
PropTypeDefaultDescription
aria-labelstring—Defines a string value that labels the current element. The text people hear: "Select Acme Robotics". Default: labels.selectRow.
classNamestring—
size"default""lg"—default 16px, or lg 20px. Default: the CheckboxGroup size, else default.
rowIdRequiredstring—The row id (row.id).
From Base UICheckbox.RootBase UI docs
idstring—The id of the input element.
namestringundefinedIdentifies the field when a form is submitted.
formstring—Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

DataTableColumnHeader

<button>
PropTypeDefaultDescription
columnRequiredstring—The column id.
childrenReactNode—The text of the head. Default: the column meta.label, else the id.
classNamestring—
menuItemsReactNode—More items at the end of the column menu, after a line: the Pro Data Grid adds Pin and Move here. Render MenuItems (or a MenuGroup).
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

DataTableSelectAllBar

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableContent

<div>
PropTypeDefaultDescription
childrenReactNode—The body states: DataTableEmpty, DataTableNoResults, and DataTableError. Each one shows only in its own state. A state you leave out shows its default content (each part registers with the content, CONTRACT C11), so pass only the states you change.
labelstring—The name of the table for screen readers ("Customers").
skeletonRowsnumber5Skeleton rows on the first load. Default 5.
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableState

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableStateHeader

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableStateIcon

<div>
PropTypeDefaultDescription
variant"default""icon"—
tone"destructive""neutral""neutral"destructive: the soft red tile of a failed load. Default neutral: the plain tile.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableStateTitle

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableStateDescription

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableStateActions

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableEmpty

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableNoResults

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableError

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableRow

<div>
PropTypeDefaultDescription
rowIdRequiredstring—The row id, for its selected fill.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTablePagination

<div>
PropTypeDefaultDescription
pageSizesreadonly number[]DATA_TABLE_PAGE_SIZESThe Rows per page choices. Default 10, 25, 50, 100.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableToolbar

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableSearch

<div>
PropTypeDefaultDescription
onSearch—Run the search: on Enter, on a clear (with ""), and after debounce ms of no typing.
onClear—The text was cleared (the clear button, or Escape with text).
debouncenumber—Ms of no typing before onSearch runs. undefined (the default): typing does not search, only Enter and a clear do. 0: each change searches.
shortcutfalse"/""mod+k"—The key that focuses and selects the field from anywhere. Default false (none).
classNamestring—Classes of the frame (the InputGroup), for its width.
busyboolean—The field waits for results: the spinner takes the place of the search icon, and the input is aria-busy.
labels—The words (SEARCH_FIELD_LABELS). Keep the object stable.
rounded"default""full"—
size"default""lg""sm""xs"—
variant"dashed""default"—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataTableFilters

PropTypeDefaultDescription
columnsreadonly string[]—The filtered columns, in menu order. Default: every column with a meta.filter.
localestring—The locale of the numbers and days.
classNamestring—Classes of the Filter button.

DataTableReset

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary"—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

DataTableViewOptions

PropTypeDefaultDescription
classNamestring—
childrenReactNode—The button text. Default: labels.view.
densitybooleantrueShow the Density group. Default true.
  • Use it when the rows need sort, selection, or pages.
  • Use manual options of TanStack Table for server data.
  • Use DataTableEmpty and DataTableError for your own words.
  • For a plain list with no state, use a Table.
TabMoves focus through the toolbar, the head menus, the boxes, and the page buttons.
FOpens the field list of the Filter button, when focus is not in a field.
EscapeClears the search while it has focus.
EnterorSpaceOpens a column menu, or ticks a box.
Left ArroworRight ArrowScrolls a table that is wider than its box.

DataTableContent takes a label that names the table.

While new data loads, the table sets aria-busy.

A wide table scrolls in its own box, and that box takes focus so the arrow keys work.

Built with

Installs with Data Table

  1. AddedData Table, with Alert, Badge, Button, Checkbox, Empty, Frame, Icon Tile, Menu, Skeleton, Table, Tooltip.
Open the release