React components for efficiently rendering large lists and tabular data
React components for efficiently rendering large lists and tabular data
React component responsible for rendering a row.
This component will receive an index and style prop by default.
Additionally it will receive prop values passed to rowProps.
ℹ️ The prop types for this component are exported as RowComponentProps
Number of items to be rendered in the list.
rowHeightRow height; the following formats are supported:
cellPropsuseDynamicRowHeight hook⚠️ Dynamic row heights are not as efficient as predetermined sizes. It's recommended to provide your own height values if they can be determined ahead of time.
rowPropsAdditional props to be passed to the row-rendering component. List will automatically re-render rows when values in this object change.
⚠️ This object must not contain ariaAttributes, index, or style props.
CSS class name.
styleOptional CSS properties. The list of rows will fill the height defined by this style.
childrenAdditional content to be rendered within the list (above cells). This property can be used to render things like overlays or tooltips.
defaultHeightDefault height of list for initial render. This value is important for server rendering.
listRefRef used to interact with this component's imperative API.
This API has imperative methods for scrolling and a getter for the outermost DOM element.
ℹ️ The useListRef and useListCallbackRef hooks are exported for convenience use in TypeScript projects.
Callback notified when the List's outermost HTMLElement resizes. This may be used to (re)scroll a row into view.
onRowsRenderedCallback notified when the range of visible rows changes.
overscanCountHow many additional rows to render outside of the visible area. This can reduce visual flickering near the edges of a list when scrolling.
rowKeyLists use the row index as a key by default.
This prop can provide a custom key value.
ℹ️ Custom keys can ensure better UX for sortable or filterable lists, particularly if your row components are stateful. Refer to the React documentation for more info.
⚠️ This prop cannot be auto-memoized because it is called during render.
It is important to always useCallback for this prop; do not use an inline function.
Can be used to override the root HTML element rendered by the List component. The default value is "div", meaning that List renders an HTMLDivElement as its root.
⚠️ In most use cases the default ARIA roles are sufficient and this prop is not needed.
### Grid Renders data with many rows and columns. ℹ️ Unlike `List` rows, `Grid` cell sizes must be known ahead of time. Either static sizes or something that can be derived (from the data in `CellProps`) without rendering. #### Required props Name Description cellComponentReact component responsible for rendering a cell.
This component will receive an index and style prop by default.
Additionally it will receive prop values passed to cellProps.
ℹ️ The prop types for this component are exported as CellComponentProps
Additional props to be passed to the cell-rendering component. Grid will automatically re-render cells when values in this object change.
⚠️ This object must not contain ariaAttributes, columnIndex, rowIndex, or style props.
Number of columns to be rendered in the grid.
columnWidthColumn width; the following formats are supported: