Skip to content
Components

Tree

Accessible tree view with roving keyboard navigation, single/multi selection, and animated disclosure.

Composition

Branching tree

  • <Tree>
    • <TreeItem>
      • <TreeItemTrigger>
        • <TreeItemIndicator />
        • <TreeItemLabel />
        </TreeItemTrigger>
      • <TreeItemContent>
        • <TreeItem>
          • <TreeItemTrigger>
            • <TreeItemLabel />
            </TreeItemTrigger>
          </TreeItem>
        </TreeItemContent>
      </TreeItem>
    </Tree>

Installation

The Control UI source installs this primitive from src/registry/sources/control-ui/ui/tree.tsx.

Registry command
See registry manifest

Dependencies

Raw code

Primary installed source

src/registry/sources/control-ui/ui/tree.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-tree-* · 10 knobsHow the cascade resolves
--cui-tree-item-trigger-radius<length-percentage>var(--radius-popup-item)
--cui-tree-item-trigger-foreground<color>var(--foreground)
--cui-tree-item-trigger-hover-background<color>var(--hover-fill)
--cui-tree-item-trigger-hover-foreground<color>var(--foreground)
--cui-tree-item-trigger-selected-background<color>var(--active-fill)
--cui-tree-item-trigger-selected-foreground<color>var(--foreground)
--cui-tree-item-trigger-font-size<length-percentage>var(--text-body)
--cui-tree-item-trigger-selected-font-weight<number>var(--font-weight-normal)
--cui-tree-indent-inset<length-percentage>1.25rem
--cui-tree-item-trigger-background<color>transparent