Overview
TherenderToggleGroup function is the default group cell renderer used by TreeDataGrid for columns specified in the groupBy prop. It renders an expand/collapse toggle control with a caret icon.
Signature
Parameters
The group cell renderer props.
RenderGroupCellProps
The value that identifies this group (displayed as the group label).
The column object for this group cell.
The group row object.
Array of child rows belonging to this group.
Whether the group is currently expanded.
The tab index for keyboard navigation.
Callback function to toggle the group’s expanded/collapsed state.
Return Value
A span element containing the group key text and an animated caret icon.
Usage
This renderer is used automatically byTreeDataGrid for grouping columns, but you can also specify it explicitly:
Features
- Visual indicator: Animated caret icon (▶ when collapsed, ▼ when expanded)
- Keyboard support: Press Enter to toggle the group
- Smooth animation: 0.1s transition when expanding/collapsing
- Accessible: Focusable with proper tab index and keyboard handling
Example
Using with TreeDataGrid:ToggleGroup Component
The underlying<ToggleGroup> component can be used directly in custom group cell renderers:
Caret Icon
- Expanded state:
M1 1 L 7 7 L 13 1(chevron pointing down) - Collapsed state:
M1 7 L 7 1 L 13 7(chevron pointing right) - Size: 14×8 pixels
- Stroke:
currentColorwith 1.5px width - Animation: Smooth path transition on state change
Related
- TreeDataGrid - Tree grid component
- Column.renderGroupCell - Group cell renderer configuration
- RenderGroupCellProps - Group cell props type