Skip to content

Data Grid

Pro

A grid that people edit like a spreadsheet, for 10,000 rows and more. People can type in cells, paste a range, undo, and export to CSV.

  • Base UI
  • React Aria
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 11, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Data Grid needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
144
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Make the table with useDataGridSetup, and pass it to the root. The save goes in onCommit.

accounts-grid.tsx

DataGrid

<div>
PropTypeDefaultDescription
childrenReactNode—
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.
refreshingboolean—New 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""compact"The row height on the first render (uncontrolled). Default default (36px).
onDensityChange—
localestring—The locale of the counts. Default: the page locale.
size"default""sm"—
labelsPartial<DataGridLabels>—The words of the grid and of its Free parts (DATA_GRID_LABELS). Keep it stable.
tableRequiredReactTable<TFeatures, TData, TSelected>—The table from useDataGridSetup.
onCommit—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>
PropTypeDefaultDescription
childrenReactNode—What shows when no row matches: a DataGridEmpty. Default: DataGridEmpty with its words.
labelRequiredstring—The name of the grid for screen readers ("Invoices").
heightnumber480The 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>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataGridUndo

<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.

DataGridRedo

<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.

DataGridSelectAll

<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.

DataGridGroupBy

PropTypeDefaultDescription
columnsreadonly string[]—The columns people may group by. Default: every column with enableGrouping on.
classNamestring—
From Base UIMenu.RootBase UI docs
defaultOpenbooleanfalseWhether the menu is initially open. To render a controlled menu, use the open prop instead.
loopFocusbooleantrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
highlightItemOnHoverbooleantrueWhether 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>
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"—
fileNamestring"rows"The file name, before .csv. Default "rows".
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.

DataGridVisibleRows

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

DataGridDensity

<div>
PropTypeDefaultDescription
classNamestring—
fullWidthboolean—
orientation"horizontal""vertical"—
rounded"default""full"—
size"default""lg""sm""xs"—
optionsreadonly DataTableDensity[]GRID_DENSITIESThe row heights to offer.
From Base UIRadioGroupBase UI docs
disabledbooleanfalseWhether the component should ignore user interaction.
readOnlybooleanfalseWhether the user should be unable to select a different radio button in the group.
requiredbooleanfalseWhether 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>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DataGridCellEditor

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

DataGridEditorValue

PropTypeDefaultDescription
editorRequiredDataGridEditor—
textRequiredstring—The cell text.

DataGridEditorCell

PropTypeDefaultDescription
cellRequired—
columnRequired—
getValueRequiredGetter<TValue>—
renderValueRequiredGetter<TValue | null>—
rowRequired—
tableRequired—
  • Use it when people edit cells in place, or when a table has thousands of rows.
  • Use useDataGridSetup with an adapter to keep the sort, filters, search, and hidden columns in the URL.
  • Use onCommit for the save: commits run in order on one queue, and a failed save rolls back.
  • For a read-only list with pages, use a Data Table.
  • For a few rows with no state, use a Table.
Arrow keysorHomeorEndorPage UporPage DownMove the ring between cells. Ctrl or Cmd with Home or End goes to the first or last row.
EnterorF2Starts an edit in the cell. A typed key starts one too.
TaborEscapeIn an editor, Tab commits and moves. Escape cancels.
Shiftarrow keysSelects a range of cells.
ModCorModVCopies the range as tab-separated text, and pastes with a preview.
ModZorModShiftZUndoes and redoes a commit.
AltLeft ArroworAltRight ArrowOn a head cell, changes the column width by 16px.

DataGridContent takes a label that names the grid, and the table has the grid role.

The grid has one Tab stop, and the arrow keys move focus between cells.

aria-rowcount and aria-rowindex give the place of a row, also when only the rows in view are drawn.

Paste and save bars in
toast · 300ms · ease-panel (0.2, 0.4, 0.2, 1) · slide up 4px and fade in
Paste and save bars out
toast-exit · 150ms · ease-out (0, 0, 0.2, 1) · slide down 4px and fade out

Built with

Installs with Data Grid

  1. AddedData Grid, with Anchor, Avatar, Badge, Button, Checkbox, Collapsible, Combobox, Data Table, Date Input, Date Picker, Drawer, Field, Frame, Input, Kbd, Menu, Rating, Segmented Control, Select, Separator, Table.
Open the release