What is Tree?
ngb-tree consumes an array of NgbTreeNode objects and renders nested lists with keyboard focus, ARIA roles, and optional checkboxes.
Data binding & selection
Bind nodes and let the component handle expand/collapse + selection state.
Selected: None
<ngb-tree
[nodes]="nodes"
[showCheckbox]="true"
(selectionChange)="onSelection($event)"
(expand)="log('expand ' + $event.label)">
</ngb-tree>JSON view
Use type="json" to show key/value nodes for configuration trees.
<ngb-tree [nodes]="settings" type="json"></ngb-tree>Localization
Provide [i18n] text and the tree adapts to RTL layouts.
<ngb-tree [nodes]="nodes" [i18n]="{ collapse: 'طي' }" dir="rtl">Accessibility & keyboard
Tree exposes role="tree", role="treeitem", arrow-key navigation, and Enter/Space to toggle selection. No extra wiring required.
<ngb-tree aria-label="Workspace tree" [nodes]="nodes"></ngb-tree>Recent events
- Interact with the tree to see events.