Table is a set of stateless components to render tables. Based on HTMLTable components.
Usage
Import
import { Table } from '@passfort/castle'content_copyCopy
Example
content_copyCopy
live example
Selectable
You can toggle select all by setting onSelectAll.
Selecting of the rows is possible only if onSelect prop exists on the row. You can also set the initial isSelected property.
content_copyCopy
live example
Expandable
You can toggle expand all by setting onExpandAll.
Expanding is done internally, but you can pass initial prop isExpanded, as well as onExpand function.
content_copyCopy
live example
Custom Components
Table.ExpandableContent is a wrapper component designed to handle nesting levels of declarative Rows and ExpandableRows.
To ensure custom content nests properly, any props that are not explicitly handled must be spread (...rest) and passed to the top-level Row or ExpandableRow being wrapped.
This is necessary because ExpandableContent passes styling-related props down the hierarchy.
content_copyCopy
live example