Pass an array of objects (each should contain id) and a list of columns (headers) to DataTable:
<DataTable
headers={headers}
data={data}
actions={Actions}
handleRowClick={handleClick}
getCellColor={getCellColor}
getValue={getCellValue}
/>
DataTable also receives optional functions: handleRowClick, getCellColor and getValue. Component that Actions function returns will be placed at the right of every row.
Styles can be added to css classses simple-table
, simple-table-cell
(can be used to style text and border color), simple-table-head
and simple-table-row
. Note that getCellColor will overwrite text color, so you will need to add !important
.