DataGrid
import { DataGrid } from '@cozmos-ui/data-grid';
Basic Use
Custom Cell
Expandable Rows
Selectable Rows
Fixed Header
See react-data-table-component for the full list of PropTypes.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| columns | arrayOf | No | [] | --- |
| data | array | No | [] | Array of objects |
| expandableRows | bool | No | false | Enable rows to be expandable |
| expandableRowsComponent | union | No | --- | React component i.e. <CustomExpander /> Receives row data as props: ({ data }) |
| fixedHeader | bool | No | false | --- |
| fixedHeaderScrollHeight | string | No | '300px' | --- |
| highlightOnHover | bool | No | true | --- |
| onSelectedRowsChange | func | No | --- | Callback to access the row selected state. Returns: ({ allSelected, selectedCount, selectedRows }) |
| pagination | bool | No | true | --- |
| paginationComponentOptions | object | No | { noRowsPerPage: true } | --- |
| paginationPerPage | number | No | 10 | --- |
| progressPending | bool | No | --- | Displays loading text |
| selectableRows | bool | No | false | Enable rows to be selected with a checkbox. |
| title | string | No | '' | The title displayed in the Table Header. |