Data grid
EuiDataGrid is for displaying large amounts of tabular data. It is a better choice over
EUI tables when there are many columns, the data in those columns is fairly uniform, and when schemas and sorting are important for comparison. Although it is similar to traditional spreedsheet software, EuiDataGrid's current strengths are in rendering rather than creating content.Core concepts
- The grid allows you to optionally define an in memory level to have the grid automatically handle updating your columns. Depending upon the level chosen, you may need to manage the content order separately from the grid.
- Schemas allow you to tailor the render and sort methods for each column. The component ships with a few automatic schema detection and types, but you can also pass in custom ones.
- Unlike tables, the data grid forces truncation. To display more content your can customize popovers to display more content and actions into popovers.
- Grid styling can be controlled by the engineer, but augmented by user preference depending upon the features you enable.
- Control columns allow you to add repeatable actions and controls like checkboxes or buttons to your grid.
- The toolbar offers the user ways to manipulate the display and order of the data.
Top level props
The below table contains a list of all top level EuiDataGrid props and sample snippets used to configure or customize them.
For a full list of all data grid types, including lower level configurations, see the /datagrid/data_grid_types.ts definition file, or view the props tables of individual datagrid sub-pages.
Prop | Sample snippet |
---|---|
Prop rowCount The total number of rows in the dataset (used by e.g. pagination to know how many pages to list). | Sample snippet
|
Prop columns An array of {@link EuiDataGridColumn} objects. Lists the columns available and the schema and settings tied to it. | Sample snippet
|
Prop leadingControlColumns An array of {@link EuiDataGridControlColumn} objects. Used to define ancillary columns on the left side of the data grid. Useful for adding items like checkboxes and buttons. | Sample snippet
|
Prop trailingControlColumns An array of {@link EuiDataGridControlColumn} objects. Used to define ancillary columns on the right side of the data grid. Useful for adding items like checkboxes and buttons. | Sample snippet
|
Prop columnVisibility An array of {@link EuiDataGridColumnVisibility} objects.
Defines which columns are intitially visible in the grid and the order they are displayed.
Users can still turn their visibility on/off when | Sample snippet
|
Prop onColumnResize A callback for when a column's size changes. Callback receives | Sample snippet
|
Prop schemaDetectors An array of custom {@link EuiDataGridSchemaDetector} objects. You can inject custom schemas to the grid to define the classnames applied. | Sample snippet |