VirtualTable API
API reference docs for theVirtualTable
component. For examples and details on the usage of this component, visit the component demo page.
Props
Props | Type | Definition | Default |
---|---|---|---|
role | 'table'|'grid' | The role attribute of the table . Use 'grid' for interactive tables that have buttons, links, or other interactive elements. | __ |
data | Array | The dataset for the table.Each item in the array represents a row in the table and can be either an object or a primitive value. | __ |
columns | Array | The columns of the table. Each column is represented by a ColumnDef object, which specifies properties such as the header, accessor, and other column configurations. | __ |
emptyTemplate? | ReactNode | Fallback template to render inside the table body when there is no data available. | __ |
|
| Sorting is enabled by default for the table. To disable sorting for the entire table, set this prop to Note: You can also disable sorting for specific columns by setting this in the column definition for the required columns. | __ |
sortDescFirst? | boolean | For numbers, the default sorting direction is DESC, while for strings, it is ASC. To apply the same sorting order (DESC) to strings as well, set this prop to true . This will make the first sorting direction DESC for all columns on the first click. | __ |
rowHeight? | number | Sets the Height of each row in the virtual table, in pixels. | 48 |
overScanRowCount? | number | Sets the number of extra rows to render above and below the visible area or smoother scrolling performance. | 5 |
containerHeight? | number | Sets the height of the container that holds the virtual table, in pixels | 400 |
onVirtualizerReady? | (virtualizer: VirtualizerUtils) => void; | Callback function that is triggered when the virtualizer instance is ready.This provides access to the MinimalVirtualizer instance, which includes the scrollToIndex method for programmatic scrolling to a specific row.This is useful for implementing features like "scroll to top" or "scroll to bottom". | __ |