WelcomeBasic ConceptsGetting StartedElementsButtonDataGridIcons

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

NameTypeRequiredDefaultDescription
columnsarrayOfNo[]---
dataarrayNo[]Array of objects
expandableRowsboolNofalseEnable rows to be expandable
expandableRowsComponentunionNo---React component i.e. <CustomExpander /> Receives row data as props: ({ data })
fixedHeaderboolNofalse---
fixedHeaderScrollHeightstringNo'300px'---
highlightOnHoverboolNotrue---
onSelectedRowsChangefuncNo---Callback to access the row selected state. Returns: ({ allSelected, selectedCount, selectedRows })
paginationboolNotrue---
paginationComponentOptionsobjectNo{ noRowsPerPage: true }---
paginationPerPagenumberNo10---
progressPendingboolNo---Displays loading text
selectableRowsboolNofalseEnable rows to be selected with a checkbox.
titlestringNo''The title displayed in the Table Header.