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>| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default""sm" | — | |
| table | ReactTable<TFeatures, TData, TSelected> | — | The table from useTable, with dataTableFeatures (or a preset that adds to it). |
| children | ReactNode | — | |
| 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. |
| refreshing | boolean | false | New data loads while the old rows stay: a 2px line under the head, and aria-busy. |
| on | — | 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). |
| default | "comfortable""compact""default" | "default" | The row height on the first render (uncontrolled). Default default (36px). |
| on | — | ||
| labels | — | The words of the table, over the English defaults (DATA_TABLE_LABELS). Keep it stable. | |
| locale | string | — | 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>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||
| size | "default""lg" | — | default 16px, or lg 20px. Default: the CheckboxGroup size, else default. | ||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UICheckbox.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | The id of the input element. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name | string | undefined | Identifies the field when a form is submitted. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| form | string | — | 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>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. The text people hear: "Select Acme Robotics". Default: labels.selectRow. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size | "default""lg" | — | default 16px, or lg 20px. Default: the CheckboxGroup size, else default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| row | string | — | The row id (row.id). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UICheckbox.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | The id of the input element. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name | string | undefined | Identifies the field when a form is submitted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| form | string | — | 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>| Prop | Type | Default | Description |
|---|---|---|---|
| column | string | — | The column id. |
| children | ReactNode | — | The text of the head. Default: the column meta.label, else the id. |
| class | string | — | |
| menu | ReactNode | — | 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | 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. |
| label | string | — | The name of the table for screen readers ("Customers"). |
| skeleton | number | 5 | Skeleton 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableStateHeader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableStateIcon
<div>DataTableStateTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableStateDescription
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableStateActions
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableNoResults
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableError
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableRow
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| row | string | — | The row id, for its selected fill. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTablePagination
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| page | readonly number[] | DATA_TABLE_PAGE_SIZES | The Rows per page choices. Default 10, 25, 50, 100. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableToolbar
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataTableSearch
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| on | — | Run the search: on Enter, on a clear (with ""), and after debounce ms of no typing. | |
| on | — | The text was cleared (the clear button, or Escape with text). | |
| debounce | number | — | Ms of no typing before onSearch runs. undefined (the default): typing does not search, only Enter and a clear do. 0: each change searches. |
| shortcut | false"/""mod+k" | — | The key that focuses and selects the field from anywhere. Default false (none). |
| class | string | — | Classes of the frame (the InputGroup), for its width. |
| busy | boolean | — | 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
DataTableReset
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | 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. | ||||
| spinner | "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 | |||||||
| focusable | boolean | false | Whether 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
| Tab | Moves focus through the toolbar, the head menus, the boxes, and the page buttons. |
|---|---|
| F | Opens the field list of the Filter button, when focus is not in a field. |
| Escape | Clears the search while it has focus. |
| EnterorSpace | Opens a column menu, or ticks a box. |
| Left ArroworRight Arrow | Scrolls a table that is wider than its box. |
- TablePick Table for plain rows and columns with no sort, filter, selection, or pages.
- FiltersLets people narrow a list with filters that read like a sentence: a field, a rule, and a value. The list changes as they pick, and phones get a sheet.
- FrameA soft tray that groups related panels under one title, with an optional footer bar for help text and the save action. Panels can be links or buttons.
- Data GridPick Data Grid (Pro) for records that people edit in cells all day, with 10,000 rows and more, paste, and undo.
Built with
Installs with Data Table







