๐Ÿš€ Socket Launch Week ๐Ÿš€ Day 5: Introducing Socket Fix.Learn More โ†’
Socket
Sign inDemoInstall
Socket

data-grid-ultra

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-grid-ultra

A react data table implementation using @mui.

4.7.1
latest
Source
npm
Version published
Weekly downloads
28
-33.33%
Maintainers
0
Weekly downloads
ย 
Created
Source

data-grid-ultra

This package is a full customized data grid component base on mui data grid library.

Buy me a coffee

Installation

Install the package in your project directory with:

npm install data-grid-ultra

Usage

import * as React from 'react';
import { DataGrid, GridColDef } from '@mui/x-data-grid';

const columns: GridColDef<(typeof rows)[number]>[] = [
  { field: 'id', headerName: 'ID', width: 90 },
  {
    field: 'firstName',
    headerName: 'First name',
    width: 150,
    editable: true,
  },
  {
    field: 'lastName',
    headerName: 'Last name',
    width: 150,
    editable: true,
  },
  {
    field: 'age',
    headerName: 'Age',
    type: 'number',
    width: 110,
    editable: true,
  },
  {
    field: 'fullName',
    headerName: 'Full name',
    description: 'This column has a value getter and is not sortable.',
    sortable: false,
    width: 160,
    valueGetter: (value, row) => `${row.firstName || ''} ${row.lastName || ''}`,
  },
];

const rows = [
  { id: 1, lastName: 'Snow', firstName: 'Jon', age: 14 },
  { id: 2, lastName: 'Lannister', firstName: 'Cersei', age: 31 },
  { id: 3, lastName: 'Lannister', firstName: 'Jaime', age: 31 },
  { id: 4, lastName: 'Stark', firstName: 'Arya', age: 11 },
  { id: 5, lastName: 'Targaryen', firstName: 'Daenerys', age: null },
  { id: 6, lastName: 'Melisandre', firstName: null, age: 150 },
  { id: 7, lastName: 'Clifford', firstName: 'Ferrara', age: 44 },
  { id: 8, lastName: 'Frances', firstName: 'Rossini', age: 36 },
  { id: 9, lastName: 'Roxie', firstName: 'Harvey', age: 65 },
];

export default function DataGridDemo() {
  return (
      <DataGrid
        rows={rows}
        columns={columns}
        initialState={{
          pagination: {
            paginationModel: {
              pageSize: 5,
            },
          },
        }}
        pageSizeOptions={[5]}
        checkboxSelection
        disableRowSelectionOnClick
      />
  );
}

Props

NameTypeDefaultDescription
columns*Array<object>-Set of columns of type GridColDef[].
aggregationFunctionsobjectGRID_AGGREGATION_FUNCTIONSAggregation functions available on the grid.
aggregationModelobject-Set the aggregation model of the grid.
aggregationRowsScope'all'|ย 'filtered'"filtered"Rows used to generate the aggregated value. If filtered, the aggregated values are generated using only the rows currently passing the filtering process. If all, the aggregated values are generated using all the rows.
apiRef{ current: object }-The ref object that allows grid manipulation. Can be instantiated with useGridApiRef().
aria-labelstring-The label of the Data Grid.
aria-labelledbystring-The id of the element containing a label for the Data Grid.
autoHeightboolfalseIf true, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
autoPageSizeboolfalseIf true, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
autosizeOnMountboolfalseIf true, columns are autosized after the datagrid is mounted.
autosizeOptions{ columns?: Array<string>, expand?: bool, includeHeaders?: bool, includeOutliers?: bool, outliersFactor?: number }-The options for autosize when user-initiated.
cellModesModelobject-Controls the modes of the cells.
cellSelectionboolfalseIf true, the cell selection mode is enabled.
cellSelectionModelobject-Set the cell selection model of the grid.
checkboxSelectionboolfalseIf true, the Data Grid will display an extra column with checkboxes for selecting rows.
checkboxSelectionVisibleOnlyboolfalseIf true, the "Select All" header checkbox selects only the rows on the current page. To be used in combination with checkboxSelection. It only works if the pagination is enabled.
classesobject-Override or extend the styles applied to the component.See CSS classes API below for more details.
clipboardCopyCellDelimiterstring' 'The character used to separate cell values when copying to the clipboard.
columnBufferPxnumber150Column region in pixels to render before/after the viewport
columnHeaderHeightnumber56Sets the height in pixel of the column headers in the Data Grid.
columnVisibilityModelobject-Set the column visibility model of the Data Grid. If defined, the Data Grid will ignore the hide property in GridColDef.
defaultGroupingExpansionDepthnumber0If above 0, the row children will be expanded up to this depth. If equal to -1, all the row children will be expanded.
density'comfortable'|ย 'compact'|ย 'standard'"standard"Set the density of the Data Grid.
detailPanelExpandedRowIdsArray<numberย |ย string>-The row ids to show the detail panel.
disableAggregationboolfalseIf true, aggregation is disabled.
disableAutosizeboolfalseIf true, column autosizing on header separator double-click is disabled.
disableChildrenFilteringboolfalseIf true, the filtering will only be applied to the top level rows when grouping rows with the treeData prop.
disableChildrenSortingboolfalseIf true, the sorting will only be applied to the top level rows when grouping rows with the treeData prop.
disableClipboardPasteboolfalseIf true, the clipboard paste is disabled.
disableColumnFilterboolfalseIf true, column filters are disabled.
disableColumnMenuboolfalseIf true, the column menu is disabled.
disableColumnPinningboolfalseIf true, the column pinning is disabled.
disableColumnReorderboolfalseIf true, reordering columns is disabled.
disableColumnResizeboolfalseIf true, resizing columns is disabled.
disableColumnSelectorboolfalseIf true, hiding/showing columns is disabled.
disableColumnSortingboolfalseIf true, the column sorting feature will be disabled.
disableDensitySelectorboolfalseIf true, the density selector is disabled.
disableEvalboolfalseIf true, eval() is not used for performance optimization.
disableMultipleColumnsFilteringboolfalseIf true, filtering with multiple columns is disabled.
disableMultipleColumnsSortingboolfalseIf true, the sorting with multiple columns is disabled.
disableMultipleRowSelectionboolfalse (!props.checkboxSelection for MIT Data Grid)If true, multiple selection using the Ctrl/CMD or Shift key is disabled. The MIT DataGrid will ignore this prop, unless checkboxSelection is enabled.
disableRowGroupingboolfalseIf true, the row grouping is disabled.
disableRowSelectionOnClickboolfalseIf true, the selection on click on a row or cell is disabled.
disableVirtualizationboolfalseIf true, the virtualization is disabled.
editMode'cell'ย |ย 'row'"cell"Controls whether to use the cell or row editing.
estimatedRowCountnumber-Use if the actual rowCount is not known upfront, but an estimation is available. If some rows have children (for instance in the tree data), this number represents the amount of top level rows. Applicable only with paginationMode="server" and when rowCount="-1"
experimentalFeatures{ warnIfFocusStateIsNotSynced?: bool }-Unstable features, breaking changes might be introduced. For each feature, if the flag is not explicitly set to true, then the feature is fully disabled, and neither property nor method calls will have any effect.
filterDebounceMsnumber150The milliseconds delay to wait after a keystroke before triggering filtering.
filterMode'client'ย |ย 'server'"client"Filtering can be processed on the server or client-side. Set it to 'server' if you would like to handle filtering on the server-side.
filterModel{ items: Array<{ field: string, id?: numberย string, operator: string, value?: any }>, logicOperator?: 'and'ย 'or', quickFilterExcludeHiddenColumns?: bool, quickFilterLogicOperator?: 'and'
getAggregationPositionfunc(groupNode) => groupNode == null ? 'footer' : 'inline'Determines the position of an aggregated value.Signature:function(groupNode: GridGroupNode) => GridAggregationPosition
getCellClassNamefunc-Function that applies CSS classes dynamically on cells.Signature:function(params: GridCellParams) => stringparams With all properties from GridCellParams.Returns: The CSS class to apply to the cell.
getDetailPanelContentfunc-Function that returns the element to render in row detail.Signature:function(params: GridRowParams) => React.JSX.Elementparams With all properties from GridRowParams.Returns: The row detail element.
getDetailPanelHeightfunc"() => 500"Function that returns the height of the row detail panel.Signature:function(params: GridRowParams) => number
getEstimatedRowHeightfunc-Function that returns the estimated height for a row. Only works if dynamic row height is used. Once the row height is measured this value is discarded.Signature:function(params: GridRowHeightParams) => number
getRowClassNamefunc-Function that applies CSS classes dynamically on rows.Signature:function(params: GridRowClassNameParams) => stringparams With all properties from GridRowClassNameParams.Returns: The CSS class to apply to the row.
getRowHeightfunc-Function that sets the row height per row.Signature:function(params: GridRowHeightParams) => GridRowHeightReturnValueparams With all properties from GridRowHeightParams.Returns: The row height value. If null or undefined then the default row height is applied. If "auto" then the row height is calculated based on the content.
getRowIdfunc-Return the id of a given GridRowModel.
getRowSpacingfunc-Function that allows to specify the spacing between rows.Signature:function(params: GridRowSpacingParams) => GridRowSpacingparams With all properties from GridRowSpacingParams.Returns: The row spacing values.
getTreeDataPathfunc-Determines the path of a row in the tree data. For instance, a row with the path ["A", "B"] is the child of the row with the path ["A"]. Note that all paths must contain at least one element.Signature:function(row: R) => Arrayrow The row from which we want the path.Returns: The path to the row.
groupingColDeffuncย |ย object-The grouping column used by the tree data.
headerFilterHeightnumber-Override the height of the header filters.
headerFiltersboolfalseIf true, enables the data grid filtering on header feature.
hideFooterboolfalseIf true, the footer component is hidden.
hideFooterPaginationboolfalseIf true, the pagination component in the footer is hidden.
hideFooterRowCountboolfalseIf true, the row count in the footer is hidden. It has no effect if the pagination is enabled.
hideFooterSelectedRowCountboolfalseIf true, the selected row count in the footer is hidden.
ignoreDiacriticsboolfalseIf true, the diacritics (accents) are ignored when filtering or quick filtering. E.g. when filter value is cafe, the rows with cafรฉ will be visible.
ignoreValueFormatterDuringExport{ clipboardExport?: bool, csvExport?: bool }ย |ย boolfalseIf true, the Data Grid will not use valueFormatter when exporting to CSV or copying to clipboard. If an object is provided, you can choose to ignore the valueFormatter for CSV export or clipboard export.
initialStateobject-The initial state of the DataGridUltra. The data in it is set in the state on initialization but isn't controlled. If one of the data in initialState is also being controlled, then the control state wins.
isCellEditablefunc-Callback fired when a cell is rendered, returns true if the cell is editable.Signature:function(params: GridCellParams) => booleanparams With all properties from GridCellParams.Returns: A boolean indicating if the cell is editable.
isGroupExpandedByDefaultfunc-Determines if a group should be expanded after its creation. This prop takes priority over the defaultGroupingExpansionDepth prop.Signature:function(node: GridGroupNode) => booleannode The node of the group to test.Returns: A boolean indicating if the group is expanded.
isRowSelectablefunc-Determines if a row can be selected.Signature:function(params: GridRowParams) => booleanparams With all properties from GridRowParams.Returns: A boolean indicating if the cell is selectable.
keepColumnPositionIfDraggedOutsideboolfalseIf true, moving the mouse pointer outside the grid before releasing the mouse button in a column re-order action will not cause the column to jump back to its original position.
keepNonExistentRowsSelectedboolfalseIf true, the selection model will retain selected rows that do not exist. Useful when using server side pagination and row selections need to be retained when changing pages.
loadingbool-If true, a loading overlay is displayed.
localeTextobject-Set the locale text of the Data Grid. You can find all the translation keys supported in the source in the GitHub repository.
logger{ debug: func, error: func, info: func, warn: func }consolePass a custom logger in the components that implements the Logger interface.
logLevel'debug'ย |ย 'error'ย |ย 'info'ย |ย 'warn'ย |ย false"error" ("warn" in dev mode)Allows to pass the logging level or false to turn off logging.
noncestring-Nonce of the inline styles for Content Security Policy.
onAggregationModelChangefunc-Callback fired when the row grouping model changes.Signature:function(model: GridAggregationModel, details: GridCallbackDetails) => voidmodel The aggregated columns.details Additional details for this callback.
onBeforeClipboardPasteStartfunc-Callback fired before the clipboard paste operation starts. Use it to confirm or cancel the paste operation.Signature:function(params: object) => voidparams Params passed to the callback.
onCellClickfunc-Callback fired when any cell is clicked.Signature:function(params: GridCellParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridCellParams.event The event object.details Additional details for this callback.
onCellDoubleClickfunc-Callback fired when a double click event comes from a cell element.Signature:function(params: GridCellParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridCellParams.event The event object.details Additional details for this callback.
onCellEditStartfunc-Callback fired when the cell turns to edit mode.Signature:function(params: GridCellParams, event: MuiEvent) => voidparams With all properties from GridCellParams.event The event that caused this prop to be called.
onCellEditStopfunc-Callback fired when the cell turns to view mode.Signature:function(params: GridCellParams, event: MuiEvent) => voidparams With all properties from GridCellParams.event The event that caused this prop to be called.
onCellKeyDownfunc-Callback fired when a keydown event comes from a cell element.Signature:function(params: GridCellParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridCellParams.event The event object.details Additional details for this callback.
onCellModesModelChangefunc-Callback fired when the cellModesModel prop changes.Signature:function(cellModesModel: GridCellModesModel, details: GridCallbackDetails) => voidcellModesModel Object containing which cells are in "edit" mode.details Additional details for this callback.
onCellSelectionModelChangefunc-Callback fired when the selection state of one or multiple cells changes.Signature:function(cellSelectionModel: GridCellSelectionModel, details: GridCallbackDetails) => voidcellSelectionModel Object in the shape of GridCellSelectionModel containing the selected cells.details Additional details for this callback.
onClipboardCopyfunc-Callback called when the data is copied to the clipboard.Signature:function(data: string) => voiddata The data copied to the clipboard.
onClipboardPasteEndfunc-Callback fired when the clipboard paste operation ends.
onClipboardPasteStartfunc-Callback fired when the clipboard paste operation starts.
onColumnHeaderClickfunc-Callback fired when a click event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnHeaderDoubleClickfunc-Callback fired when a double click event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnHeaderEnterfunc-Callback fired when a mouse enter event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnHeaderLeavefunc-Callback fired when a mouse leave event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnHeaderOutfunc-Callback fired when a mouseout event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnHeaderOverfunc-Callback fired when a mouseover event comes from a column header element.Signature:function(params: GridColumnHeaderParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnHeaderParams.event The event object.details Additional details for this callback.
onColumnOrderChangefunc-Callback fired when a column is reordered.Signature:function(params: GridColumnOrderChangeParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridColumnOrderChangeParams.event The event object.details Additional details for this callback.
onColumnResizefunc-Callback fired while a column is being resized.Signature:function(params: GridColumnResizeParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnResizeParams.event The event object.details Additional details for this callback.
onColumnVisibilityModelChangefunc-Callback fired when the column visibility model changes.Signature:function(model: GridColumnVisibilityModel, details: GridCallbackDetails) => voidmodel The new model.details Additional details for this callback.
onColumnWidthChangefunc-Callback fired when the width of a column is changed.Signature:function(params: GridColumnResizeParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridColumnResizeParams.event The event object.details Additional details for this callback.
onDensityChangefunc-Callback fired when the density changes.Signature:function(density: GridDensity) => voiddensity New density value.
onDetailPanelExpandedRowIdsChangefunc-Callback fired when the detail panel of a row is opened or closed.Signature:function(ids: Array, details: GridCallbackDetails) => voidids The ids of the rows which have the detail panel open.details Additional details for this callback.
onExcelExportStateChangefunc-Callback fired when the state of the Excel export changes.Signature:function(inProgress: string) => voidinProgress Indicates if the task is in progress.
onFetchRowsfunc-Callback fired when rowCount is set and the next batch of virtualized rows is rendered.Signature:function(params: GridFetchRowsParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridFetchRowsParams.event The event object.details Additional details for this callback.
onFilterModelChangefunc-Callback fired when the Filter model changes before the filters are applied.Signature:function(model: GridFilterModel, details: GridCallbackDetails) => voidmodel With all properties from GridFilterModel.details Additional details for this callback.
onMenuClosefunc-Callback fired when the menu is closed.Signature:function(params: GridMenuParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridMenuParams.event The event object.details Additional details for this callback.
onMenuOpenfunc-Callback fired when the menu is opened.Signature:function(params: GridMenuParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridMenuParams.event The event object.details Additional details for this callback.
onPaginationMetaChangefunc-Callback fired when the pagination meta has changed.Signature:function(paginationMeta: GridPaginationMeta) => voidpaginationMeta Updated pagination meta.
onPaginationModelChangefunc-Callback fired when the pagination model has changed.Signature:function(model: GridPaginationModel, details: GridCallbackDetails) => voidmodel Updated pagination model.details Additional details for this callback.
onPinnedColumnsChangefunc-Callback fired when the pinned columns have changed.Signature:function(pinnedColumns: GridPinnedColumnFields, details: GridCallbackDetails) => voidpinnedColumns The changed pinned columns.details Additional details for this callback.
onPreferencePanelClosefunc-Callback fired when the preferences panel is closed.Signature:function(params: GridPreferencePanelParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridPreferencePanelParams.event The event object.details Additional details for this callback.
onPreferencePanelOpenfunc-Callback fired when the preferences panel is opened.Signature:function(params: GridPreferencePanelParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridPreferencePanelParams.event The event object.details Additional details for this callback.
onProcessRowUpdateErrorfunc-Callback called when processRowUpdate throws an error or rejects.Signature:function(error: any) => voiderror The error thrown.
onResizefunc-Callback fired when the Data Grid is resized.Signature:function(containerSize: ElementSize, event: MuiEvent<{}>, details: GridCallbackDetails) => voidcontainerSize With all properties from ElementSize.event The event object.details Additional details for this callback.
onRowClickfunc-Callback fired when a row is clicked. Not called if the target clicked is an interactive element added by the built-in columns.Signature:function(params: GridRowParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from GridRowParams.event The event object.details Additional details for this callback.
onRowCountChangefunc-Callback fired when the row count has changed.Signature:function(count: number) => voidcount Updated row count.
onRowDoubleClickfunc-Callback fired when a double click event comes from a row container element.Signature:function(params: GridRowParams, event: MuiEvent, details: GridCallbackDetails) => voidparams With all properties from RowParams.event The event object.details Additional details for this callback.
onRowEditStartfunc-Callback fired when the row turns to edit mode.Signature:function(params: GridRowParams, event: MuiEvent) => voidparams With all properties from GridRowParams.event The event that caused this prop to be called.
onRowEditStopfunc-Callback fired when the row turns to view mode.Signature:function(params: GridRowParams, event: MuiEvent) => voidparams With all properties from GridRowParams.event The event that caused this prop to be called.
onRowGroupingModelChangefunc-Callback fired when the row grouping model changes.Signature:function(model: GridRowGroupingModel, details: GridCallbackDetails) => voidmodel Columns used as grouping criteria.details Additional details for this callback.
onRowModesModelChangefunc-Callback fired when the rowModesModel prop changes.Signature:function(rowModesModel: GridRowModesModel, details: GridCallbackDetails) => voidrowModesModel Object containing which rows are in "edit" mode.details Additional details for this callback.
onRowOrderChangefunc-Callback fired when a row is being reordered.Signature:function(params: GridRowOrderChangeParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridRowOrderChangeParams.event The event object.details Additional details for this callback.
onRowSelectionModelChangefunc-Callback fired when the selection state of one or multiple rows changes.Signature:function(rowSelectionModel: GridRowSelectionModel, details: GridCallbackDetails) => voidrowSelectionModel With all the row ids GridSelectionModel.details Additional details for this callback.
onRowsScrollEndfunc-Callback fired when scrolling to the bottom of the grid viewport.Signature:function(params: GridRowScrollEndParams, event: MuiEvent<{}>, details: GridCallbackDetails) => voidparams With all properties from GridRowScrollEndParams.event The event object.details Additional details for this callback.
onSortModelChangefunc-Callback fired when the sort model changes before a column is sorted.Signature:function(model: GridSortModel, details: GridCallbackDetails) => voidmodel With all properties from GridSortModel.details Additional details for this callback.
pageSizeOptionsArray<numberย |ย { label: string, value: number }>[25, 50, 100]Select the pageSize dynamically using the component UI.
paginationboolfalseIf true, pagination is enabled.
paginationMeta{ hasNextPage?: bool }-The extra information about the pagination state of the Data Grid. Only applicable with paginationMode="server".
paginationMode'client'ย |ย 'server'"client"Pagination can be processed on the server or client-side. Set it to 'client' if you would like to handle the pagination on the client-side. Set it to 'server' if you would like to handle the pagination on the server-side.
paginationModel{ page: number, pageSize: number }-The pagination model of type GridPaginationModel which refers to current page and pageSize.
pinnedColumnsobject-The column fields to display pinned to left or right.
pinnedRows{ bottom?: Array<object>, top?: Array<object> }-Rows data to pin on top or bottom.
processRowUpdatefunc-Callback called before updating a row with new values in the row and cell editing.Signature:function(newRow: R, oldRow: R) => Promise
resizeThrottleMsnumber60The milliseconds throttle delay for resizing the grid.
rowBufferPxnumber150Row region in pixels to render before/after the viewport
rowCountnumber-Set the total number of rows, if it is different from the length of the value rows prop. If some rows have children (for instance in the tree data), this number represents the amount of top level rows. Only works with paginationMode="server", ignored when paginationMode="client".
rowGroupingColumnMode'multiple'ย |ย 'single''single'If single, all the columns that are grouped are represented in the same grid column. If multiple, each column that is grouped is represented in its own grid column.
rowGroupingModelArray<string>-Set the row grouping model of the grid.
rowHeightnumber52Sets the height in pixel of a row in the Data Grid.
rowModesModelobject-Controls the modes of the rows.
rowPositionsDebounceMsnumber166The milliseconds delay to wait after measuring the row height before recalculating row positions. Setting it to a lower value could be useful when using dynamic row height, but might reduce performance when displaying a large number of rows.
rowReorderingboolfalseIf true, the reordering of rows is enabled.
rowsArray<object>[]Set of rows of type GridRowsProp.
rowSelectionbooltrueIf false, the row selection mode is disabled.
rowSelectionModelArray<numberย |ย string>ย |ย numberย |ย string-Sets the row selection model of the Data Grid.
rowsLoadingMode'client'ย |ย 'server'-Loading rows can be processed on the server or client-side. Set it to 'client' if you would like enable infnite loading. Set it to 'server' if you would like to enable lazy loading. * @default "client"
rowSpacingType'border'ย |ย 'margin'"margin"Sets the type of space between rows added by getRowSpacing.
scrollbarSizenumber-Override the height/width of the Data Grid inner scrollbar.
scrollEndThresholdnumber80Set the area in px at the bottom of the grid viewport where onRowsScrollEnd is called.
showCellVerticalBorderboolfalseIf true, the vertical borders of the cells are displayed.
showColumnVerticalBorderboolfalseIf true, the right border of the column headers are displayed.
slotPropsobject-Overridable components props dynamically passed to the component at rendering.
slotsobject-Overridable components.See Slots API below for more details.
sortingMode'client'ย |ย 'server'"client"Sorting can be processed on the server or client-side. Set it to 'client' if you would like to handle sorting on the client-side. Set it to 'server' if you would like to handle sorting on the server-side.
sortingOrderArray<'asc'ย |ย 'desc'>['asc', 'desc', null]The order of the sorting sequence.
sortModelArray<{ field: string, sort?: 'asc'ย |ย 'desc' }>-Set the sort model of the Data Grid.
splitClipboardPastedTextfunc-The function is used to split the pasted text into rows and cells.Signature:function(text: string) => voidtext The text pasted from the clipboard.
sxArray<funcย |ย objectย |ย bool>ย |ย funcย |ย object-The system prop that allows defining system overrides as well as additional CSS styles.See the sx page for more details.
throttleRowsMsnumber0If positive, the Data Grid will throttle updates coming from apiRef.current.updateRows and apiRef.current.setRows. It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
treeDataboolfalseIf true, the rows will be gathered in a tree structure according to the getTreeDataPath prop.

Slots

Slot nameClass nameDefault componentDescription
headerFilterCellGridHeaderFilterCellComponent responsible for showing menu adornment in Header filter row
headerFilterMenuGridHeaderFilterMenuComponent responsible for showing menu in Header filter row
baseChipChipThe custom Chip component used in the grid.
cell.MuiDataGridPremium-cellGridCellComponent rendered for each cell.
skeletonCellGridSkeletonCellComponent rendered for each skeleton cell.
columnHeaderFilterIconButtonGridColumnHeaderFilterIconButtonFilter icon component rendered in each column header.
columnMenuGridColumnMenuColumn menu component rendered by clicking on the 3 dots "kebab" icon in column headers.
columnHeaders.MuiDataGridPremium-columnHeadersGridColumnHeadersComponent responsible for rendering the column headers.
detailPanels.MuiDataGridPremium-detailPanelsGridDetailPanelsComponent responsible for rendering the detail panels.
footerGridFooterFooter component rendered at the bottom of the grid viewport.
footerRowCountGridRowCountRow count component rendered in the footer
toolbarnullToolbar component rendered inside the Header component.
loadingOverlayGridLoadingOverlayLoading overlay component rendered when the grid is in a loading state.
noResultsOverlayGridNoResultsOverlayNo results overlay component rendered when the grid has no results after filtering.
noRowsOverlayGridNoRowsOverlayNo rows overlay component rendered when the grid has no rows.
paginationPaginationPagination component rendered in the grid footer by default.
filterPanelGridFilterPanelFilter panel component rendered when clicking the filter button.
columnsPanelGridColumnsPanelGridColumns panel component rendered when clicking the columns button.
columnsManagement.MuiDataGridPremium-columnsManagementGridColumnsManagementComponent used inside Grid Columns panel to manage columns.
panel.MuiDataGridPremium-panelGridPanelPanel component wrapping the filters and columns panels.
row.MuiDataGridPremium-rowGridRowComponent rendered for each row.
baseCheckboxCheckboxThe custom Checkbox component used in the grid for both header and cells.
baseInputAdornmentInputAdornmentThe custom InputAdornment component used in the grid.
baseTextFieldTextFieldThe custom TextField component used in the grid.
baseFormControlFormControlThe custom FormControl component used in the grid.
baseSelectSelectThe custom Select component used in the grid.
baseButtonButtonThe custom Button component used in the grid.
baseIconButtonIconButtonThe custom IconButton component used in the grid.
baseTooltipTooltipThe custom Tooltip component used in the grid.
basePopperPopperThe custom Popper component used in the grid.
baseInputLabelInputLabelThe custom InputLabel component used in the grid.
baseSelectOptionMenuItemThe custom SelectOption component used in the grid.
booleanCellTrueIconGridCheckIconIcon displayed on the boolean cell to represent the true value.
booleanCellFalseIconGridCloseIconIcon displayed on the boolean cell to represent the false value.
columnMenuIconGridTripleDotsVerticalIconIcon displayed on the side of the column header title to display the filter input component.
openFilterButtonIconGridFilterListIconIcon displayed on the open filter button present in the toolbar by default.
columnFilteredIconGridFilterAltIconIcon displayed on the column header menu to show that a filter has been applied to the column.
columnSelectorIconGridColumnIconIcon displayed on the column menu selector tab.
columnUnsortedIconGridColumnUnsortedIconIcon displayed on the side of the column header title when unsorted.
columnSortedAscendingIconGridArrowUpwardIconIcon displayed on the side of the column header title when sorted in ascending order.
columnSortedDescendingIconGridArrowDownwardIconIcon displayed on the side of the column header title when sorted in descending order.
columnResizeIconGridSeparatorIconIcon displayed in between two column headers that allows to resize the column header.
densityCompactIconGridViewHeadlineIconIcon displayed on the compact density option in the toolbar.
densityStandardIconGridTableRowsIconIcon displayed on the standard density option in the toolbar.
densityComfortableIconGridViewStreamIconIcon displayed on the "comfortable" density option in the toolbar.
exportIconGridSaveAltIconIcon displayed on the open export button present in the toolbar by default.
moreActionsIconGridMoreVertIconIcon displayed on the actions column type to open the menu.
treeDataExpandIconGridKeyboardArrowRightIcon displayed on the tree data toggling column when the children are collapsed
treeDataCollapseIconGridExpandMoreIconIcon displayed on the tree data toggling column when the children are expanded
groupingCriteriaExpandIconGridKeyboardArrowRightIcon displayed on the grouping column when the children are collapsed
groupingCriteriaCollapseIconGridExpandMoreIconIcon displayed on the grouping column when the children are expanded
detailPanelExpandIconGridAddIconIcon displayed on the detail panel toggle column when collapsed.
detailPanelCollapseIconGridRemoveIconIcon displayed on the detail panel toggle column when expanded.
filterPanelAddIconGridAddIconIcon displayed for deleting the filter from filter panel.
filterPanelDeleteIconGridDeleteIconIcon displayed for deleting the filter from filter panel.
filterPanelRemoveAllIconGridDeleteForeverIconIcon displayed for deleting all the active filters from filter panel.
rowReorderIconGridDragIconIcon displayed on the reorder column type to reorder a row.
quickFilterIconGridSearchIconIcon displayed on the quick filter input.
quickFilterClearIconGridCloseIconIcon displayed on the quick filter reset input.
columnMenuHideIconGridVisibilityOffIconIcon displayed in column menu for hiding column
columnMenuSortAscendingIconGridArrowUpwardIconIcon displayed in column menu for ascending sort
columnMenuSortDescendingIconGridArrowDownwardIconIcon displayed in column menu for descending sort
columnMenuFilterIconGridFilterAltIconIcon displayed in column menu for filter
columnMenuManageColumnsIconGridViewColumnIconIcon displayed in column menu for showing all columns
columnMenuClearIconGridClearIconIcon displayed in column menu for clearing values
loadIconGridLoadIconIcon displayed on the input while processing.
columnReorderIconGridDragIconIcon displayed on the column reorder button.
columnMenuPinLeftIconGridPushPinLeftIconIcon displayed in column menu for left pinning
columnMenuPinRightIconGridPushPinRightIconIcon displayed in column menu for right pinning
columnMenuUngroupIconGridWorkspacesIconIcon displayed in column menu for ungrouping
columnMenuGroupIconGridGroupWorkIconIcon displayed in column menu for grouping
columnMenuAggregationIconGridFunctionsIconIcon displayed in column menu for aggregation

CSS

Class nameRule nameDescription
.MuiDataGridPremium-actionsCellactionsCellStyles applied to the root element of the cell with type="actions".
.MuiDataGridPremium-aggregationColumnHeaderaggregationColumnHeaderStyles applied to the root element of the column header when aggregated.
.MuiDataGridPremium-aggregationColumnHeader--alignCenteraggregationColumnHeader--alignCenterStyles applied to the root element of the header when aggregation if headerAlign="center".
.MuiDataGridPremium-aggregationColumnHeader--alignLeftaggregationColumnHeader--alignLeftStyles applied to the root element of the header when aggregation if headerAlign="left".
.MuiDataGridPremium-aggregationColumnHeader--alignRightaggregationColumnHeader--alignRightStyles applied to the root element of the header when aggregation if headerAlign="right".
.MuiDataGridPremium-aggregationColumnHeaderLabelaggregationColumnHeaderLabelStyles applied to the aggregation label in the column header when aggregated.
.MuiDataGridPremium-autoHeightautoHeightStyles applied to the root element if autoHeight={true}.
.MuiDataGridPremium-autosizingautosizingStyles applied to the root element while it is being autosized.
.MuiDataGridPremium-booleanCellbooleanCellStyles applied to the icon of the boolean cell.
.MuiDataGridPremium-cell--editablecell--editableStyles applied to the cell element if the cell is editable.
.MuiDataGridPremium-cell--editingcell--editingStyles applied to the cell element if the cell is in edit mode.
.MuiDataGridPremium-cell--flexcell--flexStyles applied to the cell element in flex display mode.
.MuiDataGridPremium-cell--pinnedLeftcell--pinnedLeftStyles applied to the cell element if it is pinned to the left.
.MuiDataGridPremium-cell--pinnedRightcell--pinnedRightStyles applied to the cell element if it is pinned to the right.
.MuiDataGridPremium-cell--rangeBottomcell--rangeBottomStyles applied to the cell element if it is at the bottom edge of a cell selection range.
.MuiDataGridPremium-cell--rangeLeftcell--rangeLeftStyles applied to the cell element if it is at the left edge of a cell selection range.
.MuiDataGridPremium-cell--rangeRightcell--rangeRightStyles applied to the cell element if it is at the right edge of a cell selection range.
.MuiDataGridPremium-cell--rangeTopcell--rangeTopStyles applied to the cell element if it is at the top edge of a cell selection range.
.MuiDataGridPremium-cell--selectionModecell--selectionModeStyles applied to the cell element if it is in a cell selection range.
.MuiDataGridPremium-cell--textCentercell--textCenterStyles applied to the cell element if align="center".
.MuiDataGridPremium-cell--textLeftcell--textLeftStyles applied to the cell element if align="left".
.MuiDataGridPremium-cell--textRightcell--textRightStyles applied to the cell element if align="right".
.MuiDataGridPremium-cell--withLeftBordercell--withLeftBorderStyles applied the cell if showColumnVerticalBorder={true}.
.MuiDataGridPremium-cell--withRightBordercell--withRightBorderStyles applied the cell if showColumnVerticalBorder={true}.
.MuiDataGridPremium-cellCheckboxcellCheckboxStyles applied to the cell checkbox element.
.MuiDataGridPremium-cellEmptycellEmptyStyles applied to the empty cell element.
.MuiDataGridPremium-cellSkeletoncellSkeletonStyles applied to the skeleton cell element.
.MuiDataGridPremium-checkboxInputcheckboxInputStyles applied to the selection checkbox element.
.MuiDataGridPremium-columnHeadercolumnHeaderStyles applied to the column header element.
.MuiDataGridPremium-columnHeader--alignCentercolumnHeader--alignCenterStyles applied to the column header if headerAlign="center".
.MuiDataGridPremium-columnHeader--alignLeftcolumnHeader--alignLeftStyles applied to the column header if headerAlign="left".
.MuiDataGridPremium-columnHeader--alignRightcolumnHeader--alignRightStyles applied to the column header if headerAlign="right".
.MuiDataGridPremium-columnHeader--draggingcolumnHeader--draggingStyles applied to the floating column header element when it is dragged.
.MuiDataGridPremium-columnHeader--emptyGroupcolumnHeader--emptyGroupStyles applied to the empty column group header cell.
.MuiDataGridPremium-columnHeader--filledGroupcolumnHeader--filledGroupStyles applied to the column group header cell if not empty.
.MuiDataGridPremium-columnHeader--filteredcolumnHeader--filteredStyles applied to the column header if the column has a filter applied to it.
.MuiDataGridPremium-columnHeader--lastcolumnHeader--lastStyles applied to the last column header element.
.MuiDataGridPremium-columnHeader--movingcolumnHeader--movingStyles applied to the column header if it is being dragged.
.MuiDataGridPremium-columnHeader--numericcolumnHeader--numericStyles applied to the column header if the type of the column is number.
.MuiDataGridPremium-columnHeader--pinnedLeftcolumnHeader--pinnedLeft
.MuiDataGridPremium-columnHeader--pinnedRightcolumnHeader--pinnedRight
.MuiDataGridPremium-columnHeader--sortablecolumnHeader--sortableStyles applied to the column header if the column is sortable.
.MuiDataGridPremium-columnHeader--sortedcolumnHeader--sortedStyles applied to the column header if the column is sorted.
.MuiDataGridPremium-columnHeader--withLeftBordercolumnHeader--withLeftBorder
.MuiDataGridPremium-columnHeader--withRightBordercolumnHeader--withRightBorderStyles applied the column header if showColumnVerticalBorder={true}.
.MuiDataGridPremium-columnHeaderCheckboxcolumnHeaderCheckboxStyles applied to the header checkbox cell element.
.MuiDataGridPremium-columnHeaderDraggableContainercolumnHeaderDraggableContainerStyles applied to the column header's draggable container element.
.MuiDataGridPremium-columnHeaderTitlecolumnHeaderTitleStyles applied to the column header's title element;
.MuiDataGridPremium-columnHeaderTitleContainercolumnHeaderTitleContainerStyles applied to the column header's title container element.
.MuiDataGridPremium-columnHeaderTitleContainerContentcolumnHeaderTitleContainerContentStyles applied to the column header's title excepted buttons.
.MuiDataGridPremium-columnSeparatorcolumnSeparatorStyles applied to the column header separator element.
.MuiDataGridPremium-columnSeparator--resizablecolumnSeparator--resizableStyles applied to the column header separator if the column is resizable.
.MuiDataGridPremium-columnSeparator--resizingcolumnSeparator--resizingStyles applied to the column header separator if the column is being resized.
.MuiDataGridPremium-columnSeparator--sideLeftcolumnSeparator--sideLeftStyles applied to the column header separator if the side is "left".
.MuiDataGridPremium-columnSeparator--sideRightcolumnSeparator--sideRightStyles applied to the column header separator if the side is "right".
.MuiDataGridPremium-columnsManagementFootercolumnsManagementFooterStyles applied to the columns management footer element.
.MuiDataGridPremium-columnsManagementHeadercolumnsManagementHeaderStyles applied to the columns management header element.
.MuiDataGridPremium-columnsManagementRowcolumnsManagementRowStyles applied to the columns management row element.
.MuiDataGridPremium-container--bottomcontainer--bottomStyles applied to the bottom container.
.MuiDataGridPremium-container--topcontainer--topStyles applied to the top container.
.MuiDataGridPremium-detailPaneldetailPanelStyles applied to the detail panel element.
.MuiDataGridPremium-detailPanelToggleCelldetailPanelToggleCellStyles applied to the detail panel toggle cell element.
.MuiDataGridPremium-detailPanelToggleCell--expandeddetailPanelToggleCell--expandedStyles applied to the detail panel toggle cell element if expanded.
.MuiDataGridPremium-editBooleanCelleditBooleanCellStyles applied to root of the boolean edit component.
.MuiDataGridPremium-editInputCelleditInputCellStyles applied to the root of the input component.
.MuiDataGridPremium-filterFormfilterFormStyles applied to the root of the filter form component.
.MuiDataGridPremium-filterFormColumnInputfilterFormColumnInputStyles applied to the column input of the filter form component.
.MuiDataGridPremium-filterFormDeleteIconfilterFormDeleteIconStyles applied to the delete icon of the filter form component.
.MuiDataGridPremium-filterFormLogicOperatorInputfilterFormLogicOperatorInputStyles applied to the link operator input of the filter form component.
.MuiDataGridPremium-filterFormOperatorInputfilterFormOperatorInputStyles applied to the operator input of the filter form component.
.MuiDataGridPremium-filterFormValueInputfilterFormValueInputStyles applied to the value input of the filter form component.
.MuiDataGridPremium-filterIconfilterIconStyles applied to the filter icon element.
.MuiDataGridPremium-footerCellfooterCellStyles applied to the root element of the cell inside a footer row.
.MuiDataGridPremium-footerContainerfooterContainerStyles applied to the footer container element.
.MuiDataGridPremium-groupingCriteriaCellgroupingCriteriaCellStyles applied to the root element of the grouping criteria cell
.MuiDataGridPremium-groupingCriteriaCellTogglegroupingCriteriaCellToggleStyles applied to the toggle of the grouping criteria cell
.MuiDataGridPremium-headerFilterRowheaderFilterRowStyles applied to the column header filter row.
.MuiDataGridPremium-iconButtonContainericonButtonContainerStyles applied to the column header icon's container.
.MuiDataGridPremium-iconSeparatoriconSeparatorStyles applied to the column header separator icon element.
.MuiDataGridPremium-mainmainStyles applied to the main container element.
.MuiDataGridPremium-main--hasPinnedRightmain--hasPinnedRightStyles applied to the main container element when it has right pinned columns.
.MuiDataGridPremium-menumenuStyles applied to the menu element.
.MuiDataGridPremium-menuIconmenuIconStyles applied to the menu icon element.
.MuiDataGridPremium-menuIconButtonmenuIconButtonStyles applied to the menu icon button element.
.MuiDataGridPremium-menuListmenuListStyles applied to the menu list element.
.MuiDataGridPremium-menuOpenmenuOpenStyles applied to the menu icon element if the menu is open.
.MuiDataGridPremium-overlayoverlayStyles applied to the overlay element.
.MuiDataGridPremium-overlayWrapperoverlayWrapperStyles applied to the overlay wrapper element.
.MuiDataGridPremium-overlayWrapperInneroverlayWrapperInnerStyles applied to the overlay wrapper inner element.
.MuiDataGridPremium-panelContentpanelContentStyles applied to the panel content element.
.MuiDataGridPremium-panelFooterpanelFooterStyles applied to the panel footer element.
.MuiDataGridPremium-panelHeaderpanelHeaderStyles applied to the panel header element.
.MuiDataGridPremium-panelWrapperpanelWrapperStyles applied to the panel wrapper element.
.MuiDataGridPremium-paperpaperStyles applied to the paper element.
.MuiDataGridPremium-pinnedColumnspinnedColumnsStyles applied to the pinned columns.
.MuiDataGridPremium-pinnedRowspinnedRowsStyles applied to the pinned rows container.
.MuiDataGridPremium-pinnedRows--bottompinnedRows--bottomStyles applied to the bottom pinned rows container.
.MuiDataGridPremium-pinnedRows--toppinnedRows--topStyles applied to the top pinned rows container.
.MuiDataGridPremium-pinnedRowsRenderZonepinnedRowsRenderZoneStyles applied to pinned rows render zones.
.MuiDataGridPremium-rootrootStyles applied to the root element.
.MuiDataGridPremium-root--densityComfortableroot--densityComfortableStyles applied to the root element if density is "comfortable".
.MuiDataGridPremium-root--densityCompactroot--densityCompactStyles applied to the root element if density is "compact".
.MuiDataGridPremium-root--densityStandardroot--densityStandardStyles applied to the root element if density is "standard" (default).
.MuiDataGridPremium-root--disableUserSelectionroot--disableUserSelectionStyles applied to the root element when user selection is disabled.
.MuiDataGridPremium-row--detailPanelExpandedrow--detailPanelExpandedStyles applied to the row if its detail panel is open.
.MuiDataGridPremium-row--draggingrow--draggingStyles applied to the floating special row reorder cell element when it is dragged.
.MuiDataGridPremium-row--dynamicHeightrow--dynamicHeightStyles applied to the row if it has dynamic row height.
.MuiDataGridPremium-row--editablerow--editableStyles applied to the row element if the row is editable.
.MuiDataGridPremium-row--editingrow--editingStyles applied to the row element if the row is in edit mode.
.MuiDataGridPremium-row--firstVisiblerow--firstVisibleStyles applied to the first visible row element on every page of the grid.
.MuiDataGridPremium-row--lastVisiblerow--lastVisibleStyles applied to the last visible row element on every page of the grid.
.MuiDataGridPremium-rowCountrowCountStyles applied to the footer row count element to show the total number of rows. Only works when pagination is disabled.
.MuiDataGridPremium-rowReorderCellrowReorderCellStyles applied to the root element of the row reorder cell
.MuiDataGridPremium-rowReorderCell--draggablerowReorderCell--draggableStyles applied to the root element of the row reorder cell when dragging is allowed
.MuiDataGridPremium-rowReorderCellContainerrowReorderCellContainerStyles applied to the row reorder cell container element.
.MuiDataGridPremium-rowReorderCellPlaceholderrowReorderCellPlaceholderStyles applied to the row's draggable placeholder element inside the special row reorder cell.
.MuiDataGridPremium-scrollAreascrollAreaStyles applied to both scroll area elements.
.MuiDataGridPremium-scrollArea--leftscrollArea--leftStyles applied to the left scroll area element.
.MuiDataGridPremium-scrollArea--rightscrollArea--rightStyles applied to the right scroll area element.
.MuiDataGridPremium-scrollbarscrollbarStyles applied to the scrollbars.
.MuiDataGridPremium-scrollbar--horizontalscrollbar--horizontalStyles applied to the horizontal scrollbar.
.MuiDataGridPremium-scrollbar--verticalscrollbar--verticalStyles applied to the horizontal scrollbar.
.MuiDataGridPremium-selectedRowCountselectedRowCountStyles applied to the footer selected row count element.
.MuiDataGridPremium-sortIconsortIconStyles applied to the sort icon element.
.MuiDataGridPremium-toolbarContainertoolbarContainerStyles applied to the toolbar container element.
.MuiDataGridPremium-toolbarFilterListtoolbarFilterListStyles applied to the toolbar filter list element.
.MuiDataGridPremium-treeDataGroupingCelltreeDataGroupingCellStyles applied to the root of the grouping column of the tree data.
.MuiDataGridPremium-treeDataGroupingCellToggletreeDataGroupingCellToggleStyles applied to the toggle of the grouping cell of the tree data.
.MuiDataGridPremium-virtualScrollervirtualScrollerStyles applied to the virtualization container.
.MuiDataGridPremium-virtualScrollerContentvirtualScrollerContentStyles applied to the virtualization content.
.MuiDataGridPremium-virtualScrollerContent--overflowedvirtualScrollerContent--overflowedStyles applied to the virtualization content when its height is bigger than the virtualization container.
.MuiDataGridPremium-virtualScrollerRenderZonevirtualScrollerRenderZoneStyles applied to the virtualization render zone.
.MuiDataGridPremium-withBorderColorwithBorderColorStyles applied to cells, column header and other elements that have border. Sets border color only.
.MuiDataGridPremium-withVerticalBorderwithVerticalBorderStyles applied the grid if showColumnVerticalBorder={true}.

Buy me a coffee

Keywords

react

FAQs

Package last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts