Give each option a materialized dot-path ("1", "1.1", "1.1.1", β¦) and point path-member at it. Tree mode auto-enables as soon as a path source is present β the component derives
parent and depth from the path and renders the options depth-first, indented by level.
There is no chevron or collapse: every node is always expanded. Typing does an ancestor-preserving search β the tree narrows to the matching nodes plus their ancestors, so the indentation of the results still reads as a hierarchy.
TR01 Interactive tree
Flip cascade behaviour, value policy and breadcrumb badges on a live tree.
checkbox-mode="cascade"makes checking a node select its whole subtree (a partial branch shows a tristate dash).cascade-select-policycontrols which values are emitted βrolled-upcollapses a full subtree to its root,leavesemits only leaf nodes,allemits every checked node.full-title-membergives each badge a breadcrumb (Fruit / Pome / Apple) whenshow-badge-full-titleis on β disambiguating leaves that share a name.
TR02 Search & filter
Ancestor-preserving filter vs. navigate match-jumping β and driving it from the API.
- Filter mode narrows the tree to matching nodes plus their ancestors, so
kalestill reads as Vegetable βΊ Leafy βΊ Kale β the hierarchy of the results is preserved. - Navigate mode keeps the whole tree visible and highlights matches; jump between them with Ctrl+β/β (a match navigator appears in the fullscreen overlay on touch).
- The buttons drive the same behaviour from the imperative API:
search(term)filters as if typed,clearSearch()restores the full tree, andscrollToValue()reaches any node since the tree is always expanded.
TR03 Selectable leaves only
Mark branches as pure structure β only leaves are real choices.
Branch nodes render normally (not greyed out) but have no checkbox and are skipped by keyboard navigation β only the leaves can be picked.
getIsSelectableCallbackreceives the built node, so it can read the derivednode.hasChildrento keep every branch non-selectable.- Non-selectable nodes drop their checkbox and are skipped by SelectΒ All and by keyboard arrows, but stay visually normal.