API reference
@salmonui/data-grid
271 exported symbols: 21 components, 10 functions, 182 interfaces, 52 types and 6 constants. Each name links its page with the signature, docs and members. Names re-exported from 4 other entry points are listed there, linked below.
import { … } from '@salmonui/data-grid';Components
DataGridVirtualized data grid (React 19). One scroll container, one role="grid" tree, sticky header, frozen columns outside horizontal virtualization. DataGrid state l…DataGridAggregateJSX aggregate. One aggregate of an aggregate row.DataGridAggregateRowJSX aggregate row; its <DataGridAggregate> children are the aggregates. One aggregate row of the aggregates prop.DataGridCellBody cell part. Subscribes to its own engine cell channel only, so a change to one cell re-renders one cell. memo (instead of compiler-derived memoization, the…DataGridColumnJSX column. Renders nothing; nested <DataGridColumn> children form a stacked header. A column definition: the props of <DataGridColumn> and the items of the co…DataGridDefaultCellDefault cell content: formatted text, or a read-only checkbox for displayAsCheckbox columns.DataGridDefaultPagerDataGridDetailRowDetail row keyed by its detail:<rowId> id. Re-renders when its parent row object, its async load state, or the detail render props change.DataGridDetailToggleExpand/collapse button of the detail column; re-renders only when its row's expansion changes.DataGridGroupCaptionRowGroup caption row (role="row" with one spanning gridcell).DataGridGroupIndentFrozen group indent block (levels x indent width); presentational, outside the accessibility tree.DataGridGroupPanelGroup drop area and chips.DataGridIconsProviderSupplies icon overrides to every DataGrid below it (for example one icon set for an application). Nested providers and a grid's icons prop merge over the outer…DataGridOutputStatusExport and print busy indicator: a spinner overlay with a polite status while a file or the print document is produced. Renders nothing (and never on the serve…DataGridPagerDataGridRowrole="row" part for row templates: spread rowProps and place cells inside.DataGridSearchBoxDataGridToolbarToolbar part (toolbar prop).DataGridTreeToggleTree toggle part (also for renderRow templates).
Functions
defineChildGridTypes a childGrid by its child row type (identity at runtime). The childGrid prop holds child grids of any row type, so its child rows are unknown; this helper…downloadBlobSaves a Blob or an export file through a temporary object URL. Returns false outside a browser (SSR, workers without a document), so it is safe to call anywher…useDataGridApiThe imperative API of the enclosing DataGrid, for slots and descendants.
Interfaces
DataGridAdaptiveadaptive prop object form.DataGridAdaptiveApiDataGridAdaptiveDialogOpenEventonBeforeAdaptiveDialogOpen (beforeOpenAdaptiveDialog); preventDefault() keeps it closed.DataGridAdaptivePropsDataGridAddEventonBeforeAdd / onAdd.DataGridAfterPrintEventAfter printing: the window's afterprint after a print().DataGridAggregateContextContext of aggregate templates (renderFooter, renderGroupFooter, renderGroupCaption).DataGridApiImperative DataGrid API (ref, useDataGridApi()).DataGridBeforeCopyEventonBeforeCopy: preventDefault() cancels, assigning data replaces the text.DataGridBeforeExportEventBefore an Excel or PDF export: preventDefault() cancels (the method resolves to null).DataGridBeforeFillEventonBeforeFill: preventDefault() cancels the fill.DataGridBeforePasteEventonBeforePaste: preventDefault() cancels, assigning data changes the pasted text.DataGridBeforePrintEventbeforePrint: preventDefault() cancels. Fired by print() before window.print().DataGridCellClickEventonCellClick / onCellDoubleClick. preventDefault() cancels the built-in action.DataGridCellContextDataGridCellKeyA cell by row id and column key.DataGridCellPropsDataGridCellValueChangeEventonBeforeCellValueChange / onCellValueChange.DataGridChildGridchildGrid prop: every DataGrid prop of the child, plus the child rows and the relation. The child inherits locale, dir, timeZone, and currency unless set.DataGridChildGridParentThe parent row a child grid belongs to (factory form of childGrid.data).DataGridChromeApiDataGridChromeColumnChrome fields of DataGridColumn.DataGridChromePropsDataGridClipboardApiClipboard methods of the DataGrid instance. Need editing (it registers the clipboard module).DataGridClipboardCellA cell by row id and column id (field).DataGridClipboardPropsClipboard and fill events of DataGrid (part of the editing props).DataGridColumnChooserDataGridColumnChooserContextContext of columnChooser.renderChooser, renderHeader, and renderFooter.DataGridColumnChooserItemOne listed column of the column chooser.DataGridColumnChooserOpenEventonBeforeColumnChooserOpen (cancellable).DataGridColumnDragEventonColumnDragStart / onColumnDrag (per frame) / onColumnDrop.DataGridColumnFilterColumn filter: per-column UI, default operator, and offered operators.DataGridColumnInfoRead-only public view of a compiled column, as render props and events receive it. Field names follow the name table; flags carry their resolved defaults. Valu…DataGridColumnMenuCloseEventonBeforeColumnMenuClose (cancellable: the menu stays open).DataGridColumnMenuContextDataGridColumnMenuItemClickEventonColumnMenuItemClick; preventDefault() skips the built-in action.DataGridColumnMenuOpenEventonBeforeColumnMenuOpen (cancellable: the menu stays closed).DataGridColumnPinChangeEventonBeforeColumnPinChange (cancellable) / onColumnPinChange.DataGridColumnReorderEventonBeforeColumnReorder (cancellable) / onColumnReorder, raised for every column move.DataGridColumnResizeEventonColumnResizeStart (cancellable) / onColumnResize (per frame) / onColumnResizeEnd.DataGridColumnVisibilityChangeEventonBeforeColumnVisibilityChange (cancellable) / onColumnVisibilityChange.DataGridCommandClickEventonCommandClick: preventDefault() cancels the built-in command.DataGridCommandItemOne button of a command column.DataGridContextMenuCloseEventonBeforeContextMenuClose (cancellable: the menu stays open).DataGridContextMenuContextDataGridContextMenuItemClickEventonContextMenuItemClick; preventDefault() skips the built-in action.DataGridContextMenuOpenEventonBeforeContextMenuOpen (cancellable).DataGridCopyOptionscopy(options).DataGridCoreApiImperative DataGrid API over an engine (re-exported by @salmonui/data-grid as DataGridCoreApi and extended there). Every method that takes a column accepts a f…DataGridCsvExportOptionsDataGridDataErrorContextContext of renderError (the data source failed to load).DataGridDataUiApiDataGridApi methods of the data-state UI.DataGridDataUiPropsDataGrid props of the data-state UI, the click events, and the engine dev tooling.DataGridDefaultCellPropsDataGridDeleteEventonBeforeDelete / onDelete.DataGridDetailApiDataGridDetailContextContext of renderDetail.DataGridDetailLoadContextContext of loadDetail.DataGridDetailPropsDataGridDetailToggleEventonBeforeDetailToggle / onDetailToggle.DataGridDevtoolsCommitDev-only commit report passed to globalThis.SALMON_UI_DEVTOOLS.onCommit.DataGridDialogContextContext of editing.renderDialog, renderDialogHeader, renderDialogFooter.DataGridDialogFieldOne field of the dialog form (editing.renderDialog).DataGridDialogPropsBuilt-in dialog settings (editing.dialogProps).DataGridEditApiEditing methods of the DataGrid instance.DataGridEditCancelEventonBeforeEditCancel / onEditCancel.DataGridEditColumnEditing fields of DataGridColumn.DataGridEditPropsEditing props of DataGrid.DataGridEditStartEventonBeforeEditStart / onEditStart.DataGridEditingediting prop.DataGridEditorContextContext of column renderEditor.DataGridEditorInputPropsAttributes the editor element must carry (ids, ARIA wiring, keyboard). Spread onto the focusable input.DataGridEditorOptionOne option of the select editor (editorProps.options).DataGridEditorPropsProps of the built-in editors (column editorProps). Unknown keys are ignored.DataGridEmptyContextDataGridErrorEventonError (type: 'error'): a rejected action. Not cancellable.DataGridEventBase of every DataGrid event object.DataGridExcelExportOptionsExcel options: the shared options plus the XlsxOptions of @salmonui/export/xlsx (sheetName, styles, header, footer, freezeHeader, mergeRepeatedValues, layout,…DataGridExportEventAn Excel or PDF export finished: the file is ready (before the download).DataGridExportOptionsOptions of every export method.DataGridExportWritersOn-demand Excel and PDF writer modules. Pass dynamic imports so the writers stay out of the initial bundle: excel loads the xlsx subpath and pdf the pdf subpat…DataGridFilterBuilderApiDataGridFilterBuilderOpenEventonBeforeFilterBuilderOpen (type: 'beforeFilterBuilderOpen', cancellable: the dialog stays closed).DataGridFilterBuilderPropsDataGridFilterChangeEventonBeforeFilterChange (type: 'beforeFilterChange') and onFilterChange ('filterChange').DataGridFilterConditionOne filter condition.DataGridFilterContextContext of column renderFilter (menu value editor) and renderFilterCell (filter row cell).DataGridFilterGroupNested AND/OR group: logic combines its members ({ logic: 'or', filters: [A, B] } is A OR B); member logic is ignored. A top-level group is ANDed with the othe…DataGridFilterMenuOpenEventonBeforeFilterMenuOpen (type: 'beforeFilterMenuOpen', cancellable: the menu or dialog stays closed) and onFilterMenuOpen ('filterMenuOpen', after it rendered).…DataGridFilteringfiltering prop.DataGridFocusedCellDataGridGroupCaptionContextContext of grouping.renderCaption.DataGridGroupChangeEventonBeforeGroupChange / onGroupChange.DataGridGroupToggleEventonBeforeGroupToggle / onGroupToggle (lazy and eager groups).DataGridGroupinggrouping prop.DataGridHeaderContextDataGridInfiniteScrollinfiniteScroll settings.DataGridKeyDownContextContext of onKeyDown.DataGridLoadingContextContext of renderLoading.DataGridLoadingRowContextContext of renderLoadingRow: a row of a block that is loading or failed to load.DataGridMenuItemDataGridMoveTargetTarget of moveRows(rowIds, { targetRowId, position }).DataGridOutputApiDataGridOutputColumnColumn fields of export and print.DataGridOutputPropsDataGridPageChangeEventonBeforePageChange (type: 'beforePageChange') and onPageChange ('pageChange').DataGridPagerContextContext of renderPager.DataGridPagingpaging prop.DataGridPdfExportOptionsPDF options: the shared options plus the PdfOptions of @salmonui/export/pdf (orientation, pageSize, header, footer, font, ...), passed through.DataGridPersistStatepersistState settings.DataGridPinnedColumnsCount shorthand: the first / last N visible columns are pinned.DataGridPrintOptionsDataGridPrintingPrint scope, hierarchy, detail and tree options.DataGridPropsDataGridQueryApiQuery methods of DataGridApi.DataGridQueryColumnColumn additions of the query UI.DataGridQueryPropsDataGridRestoreResultDataGridRowClickEventonRowClick / onRowDoubleClick. preventDefault() cancels the built-in action.DataGridRowContextDataGridRowDragrowDrag prop.DataGridRowDragEventRow drag events (onRowDragStart, onRowDrag, onBeforeRowDrop, onRowDrop).DataGridRowDragPreviewContextContext of renderRowDragPreview.DataGridRowElementPropsProps a custom row must spread onto its role="row" element.DataGridRowInfoRow and optional cell resolved from a row id or a DOM element.DataGridRowPropsDataGridSaveEventonBeforeSave (before the write is sent; cancellable) / onSave (after the write settled). Lists are computed on first read.DataGridScrollOptionsDataGridScrollToOptionsDataGridSearchsearch prop.DataGridSearchBoxPropsDataGridSearchBoxSearchEventDataGridSearchBox onBeforeSearch (type: 'beforeSearch'); preventDefault() skips the search.DataGridSearchChangeEventonBeforeSearchChange (type: 'beforeSearchChange') and onSearchChange ('searchChange').DataGridSelectionselection prop. Selection is on by default (single row).DataGridSelectionApiRow and cell selection methods (ids and fields).DataGridSelectionChangeEventonBeforeSelectionChange / onSelectionChange: one event per selection command, for row, cell and column selection, selecting and deselecting alike. Every select…DataGridSortChangeEventonBeforeSortChange (type: 'beforeSortChange') and onSortChange ('sortChange').DataGridSortItemOne sorted column.DataGridSortingsorting prop.DataGridSpanColumnSpan fields of a column.DataGridSpanContextDataGridToolbarContextDataGridToolbarItemA toolbar item. An object whose id is a built-in id keeps the built-in behavior (use it to change the label, icon, or alignment of a built-in). disabled is rea…DataGridToolbarItemClickEventonToolbarItemClick; preventDefault() skips the built-in action.DataGridTreetree prop (true: { childrenField: 'children' }).DataGridTreeApiTree methods of DataGridApi (rejected or empty without tree).DataGridTreeContextctx.tree of column.renderCell, getRowProps and row templates in tree mode.DataGridTreeLoadContextLoad context of tree.loadChildren.DataGridTreePropsTree props of DataGridProps.DataGridTreeRowInfoRow info of api.getTreeRow(rowId).DataGridTreeToggleEventonBeforeTreeToggle (cancel with preventDefault()) / onTreeToggle.DataGridTreeTogglePropsDataGridViewApiDataGridViewChangeEventonViewChange (type: 'viewChange'): fires once per committed change of the displayed rows (data, sort, filter, search, group, page), after the commit that rende…DataGridViewportapi.getViewport(): body scroll offsets in virtual px, body extent and rendered rows.DataGridVirtualization
Types
DataGridActionResultResult of an action method (applied, rejected, or async).DataGridAdaptiveDialogKindDialog kinds raised through onBeforeAdaptiveDialogOpen.DataGridAdaptiveRowLayoutRow layout in adaptive mode (rowRenderingMode).DataGridAdaptiveTargetWhere the adaptive layout applies (adaptiveUIMode).DataGridApiEngineapi.engine: the engine plus the façades of optional modules registered by props.DataGridColumnMenuItemIdDataGridColumnPinLogical pin side: start is the left edge in LTR and the right edge in RTL; center is the fixed zone: the column stays where it is at scroll start while the oth…DataGridCommandHandlerDataGridContextMenuItemIdDataGridContextMenuTargetDataGridDetailStatusAsync detail content state (loadDetail), per parent row.DataGridEditorTypeBuilt-in editors; HTML input vocabulary.DataGridElementPropsclassName, style, title, and data-* attributes for a row, cell, or header cell.DataGridEventSourceInput that caused an action.DataGridExportHooksExport hooks (per-cell, header cell, aggregate cell, group caption, detail).DataGridFilterDataGridFilterOperatorBuilt-in operators (the core also accepts the lowercase spellings); custom operator names pass through.DataGridFilterUiFilter UI of the grid or a column.DataGridGuardedActionQuery actions the unsaved-changes guard intercepts.DataGridIconNameEvery icon the grid renders.DataGridIconsIcon overrides. A node replaces the built-in icon (it is rendered inside the control, which keeps its accessible name, so make the node decorative); null hides…DataGridInfiniteScrollFacadeapi.engine.infiniteScroll: the infiniteScroll module façade. loadNext() reads the block after the last loaded row, retry() re-reads failed blocks, reload() re-…DataGridKeyContextDataGridKeyHandlerHandler for a keyboard command; return true when it handled the key (the event is then consumed).DataGridLinesDataGridLoadingPhaseWhat the loading indicator is shown for.DataGridLocaleTextlocaleText prop: overrides over the English catalog. Values are {param} templates ('Page {page} of {pageCount}') or plural forms ({ one: '1 row selected', othe…DataGridLocaleTextKeyKeys of the built-in catalog (DEFAULT_LOCALE_TEXT).DataGridMergeCellsDataGrid-wide merging of equal adjacent values: true both directions, 'rows' vertical (rowSpan: true on every column), 'columns' horizontal. A column's own col…DataGridOverflowOverflow of cell and header text (CSS text-overflow vocabulary).DataGridPartDataGridSortDirectionDataGridSpanSpan of a cell: a function returns an explicit span (1 = no span); true merges equal adjacent non-empty values. Called for rendered rows only.DataGridStateMethodsInstance state methods (ref, useDataGridApi()).DataGridTextWrapDataGridToolbarItemIdDataGridTreeFilterModeRelatives a filter (or a copy) keeps: matches with their ancestors (default), descendants, both, or matches only.DataGridTreeLoadStatusChild load status of a lazy parent (tree.hasChildrenField).DataGridUiCommandNamed UI commands the toolbar and menus run. A handler registered with api.registerCommandHandler wins; otherwise a module that declares the command type recei…DataGridViewChangeReasonWhat changed the view (onViewChange).
Constants
DATA_GRID_DEFAULT_LOCALE_TEXTBuilt-in English text for every user-visible core and renderer string. Keys are flat camelCase; parameters are listed per key. Menu and toolbar item labels use…DATA_GRID_DETAIL_COLUMN_IDColumn id of the detail expand/collapse column.DATA_GRID_ROW_DRAG_COLUMN_IDColumn id of the row drag handle column.DATA_GRID_ROW_NUMBER_COLUMN_IDDefault id of a type: 'rowNumber' column without id or field.DATA_GRID_SELECTION_COLUMN_IDDefault id of the type: "selection" checkbox column.
Re-exported entry points
@salmonui/data-grid/features2 symbols: 1 interface and 1 type@salmonui/data-grid/engine41 symbols: 4 functions, 25 interfaces, 11 types and 1 constant@salmonui/data-grid/engine/row-drag-state1 symbol: 1 function@salmonui/data-grid/engine/persistence2 symbols: 2 functions