Skip to main content

Tree

Tree displays hierarchical data as an expandable and collapsible structure. Users can navigate nested items and optionally select one or more nodes.

Also known as: Tree view
Salt package@salt-ds/core
Available since1.63.0
  • Provide an accessible name for the tree using aria-label or aria-labelledby.
  • Ensure node labels are descriptive and convey the purpose of each item.
  • Avoid deeply nested structures that may be difficult to navigate.
KeyFunction
Tab

Moves focus into the tree. Focus is set on the previously focused node, or the first node if no node was previously focused.

Down arrow

Moves focus to the next visible node.

Up arrow

Moves focus to the previous visible node.

Right arrow
  • If focus is on a collapsed parent node, expands the node.
  • If focus is on an expanded parent node, moves focus to the first child node.
  • If focus is on a leaf node, does nothing.
Left arrow
  • If focus is on an expanded parent node, collapses the node.
  • If focus is on a child or collapsed node, moves focus to the parent node.
Home

Moves focus to the first visible node in the tree.

End

Moves focus to the last visible node in the tree.

Enter

Selects the focused node.

Space
  • Selects the focused node.
  • In multiselect mode, toggles selection of the focused node.
*

Expands all sibling nodes at the same level as the focused node.

Ctrl / Cmd + A

In multiselect mode, selects all visible nodes.

Shift + Up arrow / Down arrow

In multiselect mode, extends selection to the previous/next node.

Type-ahead

Typing characters moves focus to the next node whose label starts with the typed string.