Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

API reference

Headless tree exposes four small directives: a root controller, tree items, nested groups, and an optional indicator. The behavior layer handles focus movement, expansion, selection, and typeahead, while the owner controls DOM shape and visuals.

tngTree

Root controller for selection mode, roving focus, visible node calculation, and typeahead.

InputTypeDefaultNotes
selectionMode'single' | 'multiple' | 'none''none'Controls whether item clicks update selection.
orientation'vertical' | 'horizontal''vertical'Adjusts orientation metadata and horizontal key semantics.
valueTngTreeValue | readonly TngTreeValue[] | nullundefinedControlled selection value.
defaultValueTngTreeValue | readonly TngTreeValue[] | nullundefinedInitial uncontrolled selection.
disabledbooleanfalseDisables traversal and interaction for the whole tree.
OutputTypeNotes
valueChangeTngTreeValue | readonly TngTreeValue[] | nullEmits when selection changes.
Host attributeValuePurpose
data-slot"tree"Stable root styling hook.
role"tree"ARIA tree role.
aria-orientation"vertical" | "horizontal"Reflects the normalized orientation input.
aria-multiselectable"true" | "false" | nullReflected whenever selection mode is not 'none'.
tabindex"0" | "-1"Keeps the composite focus entry on the active tree surface.

tngTreeItem

Focus target and state container for one node in the hierarchy.

InputTypeDefaultNotes
valueTngTreeValueRequiredUnique node identity used for selection and traversal.
expandedboolean | undefinedundefinedControlled expansion state.
defaultExpandedbooleanfalseInitial uncontrolled branch state.
disabledbooleanfalseDisables selection, expansion, and focus entry for the node.
OutputTypeNotes
expandedChangebooleanEmits when branch expansion toggles.
Host attributeValuePurpose
data-slot"tree-item"Stable node styling hook.
role"treeitem"ARIA role for each node.
tabindex"0" | "-1"Managed by the root roving-focus controller.
data-expanded"true" | "false"State hook for branch visibility.
data-selected"true" | "false"Selection styling hook.
data-disabled"true" | "false"Disabled styling hook.
aria-expanded"true" | "false" | nullOnly present for expandable branch items.
aria-selected"true" | "false" | nullOnly present when the tree selection mode is not 'none'.

tngTreeGroup and tngTreeIndicator

Groups register branch children with the parent item. Indicators mirror expansion state and forward click toggles back to the tree controller.

DirectiveState / host attrsNotes
tngTreeGroupdata-slot="tree-group", role="group"Wraps child items and tells the parent item it can expand.
tngTreeIndicatordata-slot="tree-indicator", data-expanded="true|false"Mirrors parent expansion state and toggles that state on click.

Selection and typeahead

  • ArrowUp and ArrowDown move through visible enabled nodes.
  • ArrowRight expands a collapsed branch or moves to its first visible child.
  • ArrowLeft collapses an expanded branch or moves back to the nearest selectable parent.
  • Home and End jump to the first or last visible enabled node.
  • Enter and Space toggle selection according to the active selection mode.
  • Printable keys run typeahead using item aria-label first, then text content, then the node value.