Skip to content
tree
AutoXXS (320px)XS (375px)SM (640px)MD (768px)LG (1024px)XL (1280px)XXL (1536px)
SketchMaterialiOSTamagui
DataInjectionKeyPatternsServiceTransactionProcessResearchProductQualityPerformanceSpecDomainFunctionTechnologyArchitectureConfigMiddlewareDataDatabaseDrizzleMigrationModelop-sqliteSchemaSQLState ManagementDraftKeystoneMergePatchPatchesPersistenceReactiveRedoStoreUndoTestingDeviceFactoryIsolationTypeScriptZodTopicsCommunicationBidsNVCDesignDesign ImplicationsEducationPedagogyFoundationsPsychologyAttachmentFloodingRelatingAuthentic RelatingUIEditorReact Native

tree

Fragment reference tree
tags
ui

Trees display a hierarchical list of selectable items. Items with children can be expanded and collapsed. The icon shorthand on tree-item prepends a wa-icon before the label text.

Usage

Collapsible tree with nested items
puguitree wa-tree-basic
tree
tree-item(expanded) Documents
tree-item Reports
tree-item Archive
tree-item Downloads

Attributes — tree

NameTypeDefaultDescription
selectionsingle | multiple | leafsingleSelection behaviour. multiple shows checkboxes. leaf restricts selection to leaf nodes only.

Attributes — tree-item

NameTypeDefaultDescription
expandedbooleanfalseExpand state on initial render.
selectedbooleanfalseMark item as selected.
lazybooleanfalseMarks the item as not yet loaded; emits wa-lazy-load on first expand.

CSS Custom Properties — tree

NameDefaultDescription
--indent-guide-width0Width of the indent guide line. Set to 1px to show guides.
--indent-guide-colorsurface borderColor of the indent guide.
--indent-guide-stylesolidLine style: solid, dashed, dotted.
--indent-sizevar(--wa-space-m)Indentation depth per level.

Text content: tree-item uses inline text, not a label attribute. Write tree-item(expanded) Folder Name — not tree-item(label="Folder Name").