The Table component can be used by importing { Table } from "finallyreact".
Prop Name | Prop Type | Description |
---|---|---|
columns | object[] | Columns for the table |
columns[].enableSort | boolean | Whether the column is sortable; requires onSort prop |
columns[].headerCell | (headerIndex, headerLabel) => React.ReactNode | Custom rendering for the header cell |
columns[].index | string | number | Unique identifier for the column |
columns[].label | any | Label for the column |
columns[].rowCell | object | Custom rendering for the row cell |
columns[].rowCell[].headerIndex | string | number | Unique identifier for the row cell |
columns[].rowCell[].headerLabel | any | Label for the row cell |
columns[].rowCell[].rowCellIndex | string | number | Unique identifier for the row cell |
columns[].rowCell[].rowCellLabel | any | Label for the row cell |
customSortIconAsc | React.ReactNode | Custom sort icon for ascending order |
customSortIconDesc | React.ReactNode | Custom sort icon for descending order |
defaultSortOrder | { index, order }[] | Default Sort Order object for columns |
disabled | boolean | Disables user interaction |
headerRowCellProps | HTMLAttributes | Props for the header row cells |
headerRowProps | HTMLAttributes | Props for the header row |
isMobile | boolean | Whether the table is in mobile view |
mobileCellKeyProps | HTMLAttributes | Props for the mobile cell key |
mobileCellValueProps | HTMLAttributes | Props for the mobile cell value |
onSort | ({ index, order }) => void | Callback for when a column is sorted; required for table sorting |
paginationProps | Pagination | Props for the table pagination component |
rowCellProps | HTMLAttributes | Props for the row cells |
rowProps | HTMLAttributes | Props for the rows |
rows | object[] | Rows for the table |
rows[].cells | object[] | Cells for the row |
rows[].cells[].index | string | number | Unique identifier for the row cell |
rows[].cells[].label | any | Label for the row cell |
rows[].cells[].render | (rowCellIndex, rowCellLabel) => React.ReactNode | Custom rendering for the row cell |
showPagination | boolean | Whether to show table pagination |
simple | boolean | Simple table with no styles |
sortIconProps | HTMLAttributes | Props for the sort icon |