# Tree View

A tree view presents an expandable hierarchical list whose nodes support structured keyboard navigation and may also support selection or actions.

- Type: artifact
- Domain: Experience & interface
- Level: Advanced
- Last reviewed: 2026-10-06
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/tree-view/>)

## What it means

A tree view represents parent and child nodes in a hierarchy, with expandable branches and leaf nodes. Focus, expansion, and selection are separate states: moving keyboard focus does not necessarily select an item. A tree view is an application-style widget, not simply any indented navigation list.

## Why it matters

Trees let people inspect and act on deep hierarchies without opening every level as a separate page. Their compactness comes with a demanding interaction model that must keep depth, expansion, selection, and focus understandable.

## When to use it

Use a tree view for file systems, object hierarchies, or other structures where users need to traverse and manipulate several levels in place. Use disclosure sections or ordinary nested navigation when users do not need application-style arrow-key navigation and selection.

## How it works

1. Model each node’s parent, children, expanded state, selectable state, and available actions.
2. Show hierarchy and expansion visually while exposing level, position, and state programmatically.
3. Implement expected arrow-key movement, Home, End, type-ahead, and expansion behavior.
4. Distinguish keyboard focus from selection, especially when multiple nodes may be selected.
5. Test deep nesting, lazy loading, long labels, virtualization, screen readers, and recovery after deletion or movement.

## A practical example

A data-platform console uses a tree view for workspaces, datasets, and tables. Right Arrow expands a dataset, Down Arrow moves to the next visible node, and selecting a table opens its details; the focused node and selected node remain visually distinct.

## Where it breaks

Deep trees are hard to scan on small screens, complex keyboard rules raise implementation cost, and lazy loading can make set position uncertain. Many website navigation structures work better as simpler disclosure lists.

## Common mistakes

- Applying tree semantics to ordinary nested links without tree keyboard behavior.
- Treating focus, expansion, and selection as the same state.
- Hiding hierarchy when labels wrap or the view becomes narrow.
- Removing a focused node without moving focus to a logical survivor.

## Sources

1. [Tree View Pattern](<https://www.w3.org/WAI/ARIA/apg/patterns/treeview/>) — W3C Web Accessibility Initiative · Technical guidance
2. [Tree view](<https://carbondesignsystem.com/components/tree-view/usage/>) — Carbon Design System · Institutional design system

## Related topics

- [Information Architecture](<https://wiki.soroush.uk/topic/information-architecture/>)
- [Accordion](<https://wiki.soroush.uk/topic/accordion/>)
- [Keyboard Accessibility](<https://wiki.soroush.uk/topic/keyboard-accessibility/>)
