Make the table with useDataGridSetup, and pass it to the root. The save goes in onCommit.
accounts-grid.tsx
DataGrid
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | |
| status | "empty""error""loading""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 | — | 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" | "compact" | The row height on the first render (uncontrolled). Default default (36px). |
| on | — | ||
| locale | string | — | The locale of the counts. Default: the page locale. |
| size | "default""sm" | — | |
| labels | Partial<DataGridLabels> | — | The words of the grid and of its Free parts (DATA_GRID_LABELS). Keep it stable. |
| table | ReactTable<TFeatures, TData, TSelected> | — | The table from useDataGridSetup. |
| on | — | Saves one step: an edit, a paste, an undo, or a redo, with every cell it changes. Steps run one at a time, in order. Before the promise resolves, update your data, with a new object for each changed record (a record that stays the same object draws no change). A rejection rolls the cells back and shows its Error message with Retry; no new edit starts until a Retry or a Dismiss. | |
| validate | — | Checks a value after the check of the editor kind: return a message to refuse it, else null. A paste counts a refused value as skipped. | |
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. |
DataGridContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What shows when no row matches: a DataGridEmpty. Default: DataGridEmpty with its words. |
| label | string | — | The name of the grid for screen readers ("Invoices"). |
| height | number | 480 | The height of the scroll box. Default 480px. |
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. |
DataGridEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataGridUndo
<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. | ||||
DataGridRedo
<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. | ||||
DataGridSelectAll
<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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
DataGridGroupBy
| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| columns | readonly string[] | — | The columns people may group by. Default: every column with enableGrouping on. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIMenu.RootBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the menu is initially open. To render a controlled menu, use the open prop instead. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| loop | boolean | true | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| highlight | boolean | true | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DataGridExport
<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" | — | |||||
| file | string | "rows" | The file name, before .csv. Default "rows". | ||||
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. | ||||
DataGridVisibleRows
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
DataGridDensity
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||
| full | boolean | — | ||||||||||||||||||||||||||||||||||
| orientation | "horizontal""vertical" | — | ||||||||||||||||||||||||||||||||||
| rounded | "default""full" | — | ||||||||||||||||||||||||||||||||||
| size | "default""lg""sm""xs" | — | ||||||||||||||||||||||||||||||||||
| options | readonly DataTableDensity[] | GRID_DENSITIES | The row heights to offer. | |||||||||||||||||||||||||||||||||
From Base UIRadioGroupBase UI docs | ||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | |||||||||||||||||||||||||||||||||
| read | boolean | false | Whether the user should be unable to select a different radio button in the group. | |||||||||||||||||||||||||||||||||
| required | boolean | false | Whether the user must choose a value before submitting a form. | |||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||
DataGridStatus
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DataGridCellEditor
<div>DataGridEditorValue
DataGridEditorCell
| Arrow keysorHomeorEndorPage UporPage Down | Move the ring between cells. Ctrl or Cmd with Home or End goes to the first or last row. |
|---|---|
| EnterorF2 | Starts an edit in the cell. A typed key starts one too. |
| TaborEscape | In an editor, Tab commits and moves. Escape cancels. |
| Shiftarrow keys | Selects a range of cells. |
| ModCorModV | Copies the range as tab-separated text, and pastes with a preview. |
| ModZorModShiftZ | Undoes and redoes a commit. |
| AltLeft ArroworAltRight Arrow | On a head cell, changes the column width by 16px. |
Built with
Installs with Data Grid
- Components
- Anchor,Avatar,Badge,Button,Checkbox,Collapsible,Combobox,Data Table+ 13 more









