The row type.
The context type. Inferred
from context; defaults to unknown.
OptionalapiReceives the imperative GridApi. Accepts a ref object or a callback ref.
OptionalclassExtra classes on the grid's outer frame.
The columns to render.
Define these as a module constant or memoise on [] — anything volatile
belongs in DataGridProps.context instead.
OptionalcontextVolatile app state handed to every cell renderer.
This is the escape hatch that keeps columns static: put in-flight ids,
permission checks and event handlers here, and changing them re-renders
cells without rebuilding a single column definition.
Where rows come from. Memoise it; a new identity causes a refetch.
OptionaldefaultRows per page before the user changes it. A persisted preference wins.
OptionaldefaultThe grouping before the user changes it, when uncontrolled. A grouping persisted under DataGridProps.storageKey wins, including a persisted "ungrouped".
OptionalemptyShown when a query returns no rows.
OptionalexportBase file name for CSV export, without the extension.
OptionalfloatingShow the always-visible filter inputs under the header. Free-text columns get a search box with a × button that clears that column's filter; other filter kinds show a read-only summary and are edited from the header popover.
OptionalgetReads how many rows a group row stands for, shown beside its value.
Return null to show no count.
OptionalgetClasses for one row's background, by its data -- e.g. to tint rows by status. A non-empty result replaces the striping; the editing and selected colours still win, and so does hover.
The colour must be opaque: the sticky selection and pinned cells paint
the row's background, and a translucent one lets scrolled cells show
through. As with cellClassName, the classes must be ones your Tailwind
build can see.
Stable identity for a row, used for selection, editing and GridApi.updateRows. Must be stable across refetches.
OptionalgroupRows fetched each time a group is opened or its "Load more" is used.
OptionalheaderHeader height in pixels.
OptionalheightHeight of the whole grid. Any CSS length; a number is treated as pixels.
OptionalisWhich rows may be selected. A row it returns false for keeps its
checkbox, greyed out and inert, and is skipped by shift-ranges, by the
header's select-all and by GridApi.selectAll.
An id selected while its row was selectable stays selected if the row later stops being so; call GridApi.clearSelection when that matters.
OptionalonCalled when a fetch or a commit throws. Aborted requests are not reported.
OptionalonEnables row editing. Called when the user commits a row.
Return { ok: false, errors } to keep the row open and paint each message
onto the cell whose column id it is keyed by.
OptionalonEnables dropping files onto a row (e.g. to attach documents to it).
OptionalonCalled when the user groups or ungroups, from the header menu, the "Grouped by" chip, or GridApi.setRowGroup.
The new grouping column, or null.
OptionalonCalled whenever the selection changes.
OptionalpagePage sizes offered in the pager.
OptionalrowThe column id to group by, null for none — the controlled form. Leave it
undefined to let the grid own the grouping (see
DataGridProps.defaultRowGroupColId).
Grouping is single-level and done by the server: the grid asks for group
rows, then for one group's rows as it is opened. See HxRowsRequest
for both requests. A column id that is unknown or lacks
ColumnDef.enableRowGroup is treated as null. Controlled grouping
is not persisted.
OptionalrowRow height in pixels. Fixed for every row — that is what keeps virtualization O(1).
OptionalselectableShow the checkbox selection column.
OptionalstoragelocalStorage key for column layout, sort, filters and page size.
Omit it and nothing is persisted. Stored under hxg:<storageKey>.
OptionaltoolbarRendered into the toolbar strip above the header, left of the built-in Columns and Export CSV buttons. The built-in Export CSV exports the selection when there is one, otherwise every matching row, up to 1000; see GridApi.exportCsv.
Props for DataGrid.