The Table component is used to show information from a data set.
View source codeTableColumn<T>[]
The columns to display.
T[]
The data to display.
string
className for the element.
SortState
Defines the default sort state (direction and column id). Sorting capability is disabled when groupBy is provided.
Default: { direction: 'none', columnId: null, }{ title: string; subtitle?: ReactNode; }
The content to display if the data is empty.
ReactNode
The footer of the Table.
(row: T) => boolean
Function to get whether a row is active.
(option: T) => boolean
Get whether a given row should be checkable. By default, all options can be checked.
(row: T) => boolean
Function to get whether a row is disabled.
(row: T) => string
Function to get a row's unique identifier.
(row: T) => TableVariant
Function to get the row's visual style.
(row: T) => string
Function to group row together. Disable sorting capability.
string | number
The maximum height of the Table (will allow the rows to be scrollable).
NextSortDirection
Defines the direction following each sort direction. Sorting capability is disabled when groupBy is provided.
Default: { // when you click on an unsorted column, it goes to Descending order none: 'descending', descending: 'ascending', ascending: 'none', }(rows: T[], rowIds: string[], isChecked: boolean) => void
Handler that is called when the top checkbox state changes.
(row: T) => void
Handler that is called when a row is clicked.
(row: T, rowId: string, isChecked: boolean) => void
Handler that is called when the selection changes.
(value: string, aggregatedRows: T[]) => ReactNode
Render function for grouped option. If not provided, the key returned by groupBy will be displayed
"compact" | "normal"
The size of the rows.
Default: normalstring[]
The current checked items in the Table.
TableMiniColumn<T>[]
The columns to display.
T[]
The data to display.
(row: T) => string
Function to get a row's unique identifier.
string
className for the element.