ApexTree — Collapse Badges

When a node is collapsed the expand/collapse button itself shows the total number of hidden descendants: it widens into a pill and swaps its + glyph for the count. The button returns to a plain circle when the node is expanded again.

Default count (top direction)

Bob and Jane are pre-collapsed — click their buttons to toggle.

Left direction + custom count colors

Custom green count pill. Click to expand/collapse.

collapseBadgeThreshold: 3

Count only shown when ≥ 3 nodes hidden. Bob (5) shows; Jane keeps a plain +.

collapseBadgeEnabled: false

Plain + glyph even when collapsed, no count.

CSS custom property theming

Red count pill via --apex-tree-badge-bg and --apex-tree-badge-color.

Right direction

The count rides in the button, which sits on the node's right edge.