Live demo — this example is server-driven; run the showcase locally for the interactive version.

Tree view

A tree view is a structure that displays data in a hierarchical view.

Examples

Single selectable

Multiselectable

A tree can be set up to allow multiple nodes to be selected. To turn on multiple selection, set aria-multiselectable="true" on the root ul[role="tree"] element.

With separate selection and expansion

The node renders its toggle button and text button separately so a parent node can be selected (or deselected) without toggling its expansion. The wrapper becomes a div.pf-v6-c-tree-view__node containing two child buttons — one for toggle, one for the label.

A search input can be used to filter tree view items. It is recommended that a tree view with more than 7 nodes includes a search input.

With checkboxes

  • Application launcher
    • Application 1
      • Settings
      • Loader
    • Application 2
      • Settings
      • Current
        • Loader app 2
        • Loader app 3

With icons

With unique icon per item

With badges

With custom badges

With action items

Guides

Compact

Compact no background

With non-expandable top level nodes