Documentation
Collapsible Columns
Collapsible columns allow users to dynamically hide and show grouped columns to optimize screen space and focus on relevant data. Click the arrow icons in column headers to collapse entire column groups while keeping important columns visible.
Basic Implementation
Collapsible columns are created by adding the collapsible: true property to a parent column with children columns. Users can click the arrow icon in the header to collapse the column group.
Collapsible Columns Configuration
Collapse Behaviors
Collapsible columns support different behaviors when collapsed:
Visibility Control
Control when child columns are visible using the showWhen attribute:
showWhen: "parentExpanded"- Visible when parent is expandedshowWhen: "parentCollapsed"- Visible when parent is collapsedshowWhen: "always"- Always visibleSingle Row Children
By default, collapsible columns create a nested header structure where the parent header appears above its children. Using singleRowChildren: true, you can display the parent header beside its children in the same row, making it appear as a regular column that collapses adjacent columns.
Custom Styling
You can customize the appearance of collapsible columns using CSS classes and variables. This allows you to style sub-headers and sub-cells differently from regular columns.
CSS Classes
Sub-Header Styling
.st-header-cell.st-sub-headerTargets child header cells within collapsible column groups.
Sub-Cell Styling
.st-cell.st-sub-cellTargets body cells within collapsible column groups.
CSS Variables
Use these CSS variables to customize the background colors of sub-headers and sub-cells. See the Custom Theme documentation for more details.
--st-sub-header-background-color--st-sub-cell-background-color--st-sub-cell-hover-background-colorNew in v1.8.6: Controls hover state for sub-cells
--st-dragging-sub-header-background-colorNew in v1.8.6: Controls background color when dragging sub-headers
--st-selected-sub-cell-background-colorNew in v1.8.6: Controls background color for selected sub-cells
--st-selected-sub-cell-colorNew in v1.8.6: Controls text color for selected sub-cells