Data Grid
warning
There are known styling issues with sortable columns when used in a NextJS app.
A data grid is a component designed to display large volumes in a structured and organized manner. It structures data into rows and columns, making it easy for users to visualize, analyze, and interact with the information. The data grid also improves user experience by providing features like sorting, filtering, and editing.
Name | Type | Description | Default |
---|---|---|---|
Required |
{
key: string;
label: string;
resizable?: boolean;
sortable?: boolean;
draggable?: boolean;
textEditable?: boolean;
summaryKey?: string;
alignment?: "left" | "right" | "center";
} | Each GridColumn object has the following properties:
| - |
Required | GridRow[] | HierarchyGridRow[] | ExpandableGridRow[] Each one of them being in order: {
[key: string]: React.ReactNode | undefined;
} GridRow & {
childRows?: HierarchyGridRow[] | GridRow[];
} GridRow & {
expandedContent?: React.ReactNode;
expandedContentHeight?: number;
} | List of rows that will be rendered in each cell based on the key in each column. | - |
expandable | boolean | Whether the rows can expand or not. | - |
summaryRow | GridRow | Extra row that will be always visible. | - |
selectable | boolean | Whether the rows are selectable or not. | - |
selectedRows | Set<string | number> | Set of selected rows. This prop is mandatory if selectable is set to true. The uniqueRowId key will be used to identify the each row. | - |
onSelectRows | (selectedRows: Set<number | string>) => void | Function called whenever the selected values changes. This prop is mandatory if selectable is set to true.The uniqueRowId key will be used to identify the rows. | - |
uniqueRowId | string | This prop indicates the unique key that can be used to identify each row. This prop is mandatory if selectable is set to true, expandable is set to true or rows is of type HierarchyGridRow[] . | - |
onGridRowsChange | (rows: GridRow[] | HierarchyGridRow[] | ExpandableGridRow[]) => void | Function called whenever a cell is edited. | - |