Log-in required.

You are trying to access the internal Editor Foundations design system.
Sign-in with your Unity Google account to continue, or visit the public site.

Implementation references

Scripting API and implementation references.

UI Toolkit


Tree view in use in project window
  • Tree view displays in a multi-tiered hierarchy unlike list view which displays items as a flat list
  • This control only creates visual elements for visible items while allowing the binding of many more items
  • As the user scrolls, visual elements in tree view are recycled and re-bound to new data items

Tree view APIs

Tree view and tree view Item in project window

Tree view in UI Toolkit

UI Toolkit
Tree view in IMGUI
Makes a hierarchical list of items
Defines information for each tree view item


Comparing tree view, list view, and foldout

1. Tree View 2. List view 3. Foldout
  • Tree view is used for displaying items in a multi-tiered hierarchy, like a folder structure
  • List view is used for displaying items as a flat list
  • Foldout is used to expand or collapse a single level of mixed content, like Inspector controls


Row height
An annotated diagram of a foldout header and foldout contents
Tree view and list views with 16 px row heights

Tree View and List View items can have different height values by changing the virtualization method ->

Alternating row backgrounds

Use showAlternatingRowBackgrounds property to add alternating row background colors to the TreeView.

Show border

Use showBorder property to show a border around the TreeView.

Multi column header

Use multiColumnHeader property to get the MultiColumnHeader of the TreeView. Can be null if the TreeView was created without a MultiColumnHeader.

Header label style
An annotated diagram of a foldout header and foldout contents
Bold and regular label styles in tree view items

Header label text can be bold to signify a main parent folder in the hierarchy, such as assets folder in project window.

Tree view indentation and nesting
An annotated image of nested foldouts and the pixel values of each indentation level
Nested tree view items displaying indentation values
  • Tree view content is indented 15 pixels for each nested level
  • Nested tree view item limit is six items - beyond that the 15 px indentation padding is not adjusted
  • Foldout arrow is rendered offset from the content area


Scrolling content

Tree view contents are always displayed in a scroll view container to enable scrolling when the contents are larger than the viewport.

  • Vertical scrolling is enabled by default
  • Use showingHorizontalScrollBar property to display horizontal scrolling in IMGUI framework
Expand and collapse
Tree view expand and collapse behavior

In tree views (e.g. hierarchy, project window), clicking on the foldout arrow expands the foldout, and clicking on the foldout text selects the tree view element.

Drag and drop to reorder and nest
Cursor changing format while moving
Tree view items can be dragged to reorder their position, e.g. hierarchy window
Cursor changing format while moving
Tree view items can be dragged into other folders to nest them, e.g. project window
Renaming tree view Items

Double clicking on a tree view item allows for renaming of the selected item.


Anatomy and layout

Anatomy of a tree view and its key parts

A Tree view can contain and be paired with the following elements:

1. TreeView
2. TreeViewItem
3. Scrollbar

Interaction states

The various interactive states of a tree view

An open tree view item displaying its children.


A collapsed tree view item.

Default (inactive)

Default state of tree view item.


When hovered, tree view item rows are highlighted.


When selected, tree views rows are highlighted.


When focused, tree view item labels are highlighted in blue.


Disabled tree view items.


1. Tree view item label 2. Foldout arrow  3. Icon
1. Tree view item label
The default text color
The default text color when the mouse pointer hovers over the text
The text color for selected items or selected text when the control does not have focus
The text color for a label when it has focus
2. Foldout arrow
Foldout Arrow
Foldout arrow color
3. Icon
Primary Icon Color
Icons that don’t require to be color coded uses this color
Tree view item backgrounds
The alternate background color for views with alternating row colors
The background color for selected items or selected text
The background color for line items when the mouse pointer hovers over them
rgba(0, 0, 0, 0.0627451)
rgba(256, 256, 256, 0.0627451)
The background color for an item with a line specific background color when the mouse pointer hovers over them

Code samples