Castle logo

CASTLE UI

Search

K

Table is a set of stateless components to render tables. Based on HTMLTable components.

Usage

Import

import { Table } from '@passfort/castle'

Copy

Example

Copy

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.

Copy

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.

Copy

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.

Copy

live example

Contents