Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
Data displayApple

Tree

Browse hierarchical records with controlled disclosure and selection.

Public APILumenTreeApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple Vision · visionOS 1+

Native example

Use Tree

Use stable flat graph identities. Invalid graphs fail closed; state edits retain unknown host IDs. Read-only selection still permits disclosure. Localize depth and disclosure formatters.

Tree rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulator
swift
LumenTree("Files", nodes: nodes, expandedIds: $expanded, selectedIds: $selected)

Reference

Public API

The primary shared and platform-specific options exposed by LumenTree.

APIValues or typeDefaultDescription
nodesLumenTreeNode recordsRequiredDefines stable identity, parent, label and disabled/selectable state.
expandedIds / selectedIdsControlled setsRequired expansion / optional selectionPreserves host state through hidden and unavailable nodes.
loading / error / readOnlyPlatform state valuesReady / no error / editableHides stale controls during result states and guards mutations.

Native behavior

Design and accessibility

When to use it

Use stable flat graph identities. Invalid graphs fail closed; state edits retain unknown host IDs. Read-only selection still permits disclosure. Localize depth and disclosure formatters.

Accessibility

Localized disclosure and depth with native selection controls and inherited disabled state.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package