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 since | 1.63.0 |
- Provide an accessible name for the tree using
aria-labeloraria-labelledby. - Ensure node labels are descriptive and convey the purpose of each item.
- Avoid deeply nested structures that may be difficult to navigate.
| Key | Function |
|---|---|
| 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 |
|
| Left arrow |
|
| 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 |
|
| * | 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. |