artifactExperience & interface

Tree View

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

Download Markdown (.md)

01What 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.[1][2]

02Why 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.

03When 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.

04How 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.

05A practical example

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.

06Where 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.

07Sources

  1. Tree View PatternW3C Web Accessibility Initiative · Technical guidanceTree View Pattern
  2. Tree viewCarbon Design System · Institutional design systemTree view
View saved topics

Start typing to search titles, definitions, categories, and frameworks.