Tree select

Hierarchical, async, searchable select. Data flows through a TreeSelectProvider (lazy roots / children / server search); selection is held as full TreeNode objects. Bind value and update it from onValueChange.

Styling — this component renders in the light DOM

It has no shadow root. Anything you render into it — row templates, node templates, cell renderers — stays in the document, so your app's stylesheet, your own component styles and Bootstrap's utility classes reach it normally.

Its own CSS is scoped at build time onto a data-mps attribute, the same device Angular uses for _ngcontent, so it cannot leak out onto your markup.

The trade-off runs the other way: page CSS now reaches this component's internals, exactly as emulated encapsulation behaves everywhere else.::part() and ::slotted() no longer address it — use ordinary CSS selectors instead.

Single + server search

No items

Selected: —

// Server-backed provider: each level lazy-loads, search hits /api/treeItems/search.const provider = useMemo(() => new HttpTreeSelectProvider(), []);const [value, setValue] = useState<TreeNode | null>(null);<BsTreeSelect  provider={provider}  mode="single"  placeholder="Search the org…"  value={value}  onValueChange={v => setValue(v as TreeNode | null)}/>

Multiple (chips)

No items

Selected: —

const provider = useMemo(() => new InMemoryTreeSelectProvider(SAMPLE_TREE), []);const [value, setValue] = useState<TreeNode[]>([]);<BsTreeSelect  provider={provider}  mode="multiple"  placeholder="Pick teams…"  value={value}  onValueChange={v => setValue(v as TreeNode[])}/>

Checkbox + cascade

No items

Selected: —

<BsTreeSelect  provider={provider}  mode="checkbox"  cascadeSelect  placeholder="Pick teams…"  value={value}  onValueChange={v => setValue(v as TreeNode[])}/>

Button variant + clear

Selected: —

<BsTreeSelect  provider={provider}  mode="single"  variant="button"  showClear  placeholder="Choose a department"  value={value}  onValueChange={v => setValue(v as TreeNode | null)}/>