Skip to content

TreeProps

Defined in: react/components/data/tree.tsx:6

Props for Tree.

optional className?: string

Defined in: react/components/types.ts:24

Space-separated class names (currently advisory; no CSS cascade).

ComponentProps.className


data: TreeNode[]

Defined in: react/components/data/tree.tsx:8

Forest of top-level nodes. A flat list needs no synthetic root.


optional disabled?: boolean

Defined in: react/components/types.ts:52

Marks the widget (and its descendants) as inert: not focusable, ignores key/mouse input, and interactive controls render in a muted style. A disabled container propagates to every control inside it.

ComponentProps.disabled


optional expanded?: string[]

Defined in: react/components/data/tree.tsx:14

Expanded node ids. Controlled when onExpandedChange is provided.


optional focusable?: boolean

Defined in: react/components/types.ts:40

Allow this widget to take keyboard focus.

ComponentProps.focusable


optional focusOnClick?: boolean

Defined in: react/components/types.ts:46

When a click lands on this container (its padding, border, or a non-focusable child), move focus to its first focusable descendant — so clicking a Form/Panel/Box hands focus to its first field. Off by default.

ComponentProps.focusOnClick


optional guideColor?: string

Defined in: react/components/data/tree.tsx:20

Color of the indentation guides. Subtle/muted by default.


optional hideRoot?: boolean

Defined in: react/components/data/tree.tsx:10

Present each root’s children as the top level (hide the root nodes).


optional hoverInterest?: boolean

Defined in: react/components/types.ts:66

Opt-in hint that this widget cares about passive hover movement.

ComponentProps.hoverInterest


optional id?: string

Defined in: react/components/types.ts:22

Stable identifier, handy for tests and lookups.

ComponentProps.id


optional label?: string

Defined in: react/components/types.ts:36

Structural/accessible label (also the tab title inside TabContainer).

ComponentProps.label


optional onActivate?: (node) => void

Defined in: react/components/data/tree.tsx:24

Item activated — Enter, Space, or double-click.

TreeNode

void


optional onClick?: (ev) => void

Defined in: react/components/types.ts:54

Pointer click.

any

void

ComponentProps.onClick


optional onDragEnd?: (x, y, moved) => void

Defined in: react/components/types.ts:72

Drag released; moved is false for a tap with no movement.

number

number

boolean

void

ComponentProps.onDragEnd


optional onDragMove?: (x, y) => void

Defined in: react/components/types.ts:70

Pointer moved while dragging from this widget.

number

number

void

ComponentProps.onDragMove


optional onDragStart?: (x, y) => void

Defined in: react/components/types.ts:68

Pointer-drag lifecycle; moved is false for a tap with no movement.

number

number

void

ComponentProps.onDragStart


optional onExpandedChange?: (expanded) => void

Defined in: react/components/data/tree.tsx:28

The set of expanded ids changed.

string[]

void


optional onKey?: (ev) => void

Defined in: react/components/types.ts:58

Key event while focused; set ev.handled to consume it.

any

void

ComponentProps.onKey


optional onMouseDown?: (ev) => void

Defined in: react/components/types.ts:56

Pointer pressed (any button); the event carries button and x/y.

any

void

ComponentProps.onMouseDown


optional onMouseEnter?: (ev) => void

Defined in: react/components/types.ts:62

Pointer entered this widget’s region.

any

void

ComponentProps.onMouseEnter


optional onMouseLeave?: (ev) => void

Defined in: react/components/types.ts:64

Pointer left this widget’s region.

any

void

ComponentProps.onMouseLeave


optional onScroll?: (ev) => void

Defined in: react/components/types.ts:60

Wheel / scroll event.

any

void

ComponentProps.onScroll


optional onSelect?: (node) => void

Defined in: react/components/data/tree.tsx:22

Selection changed (arrow navigation or single click).

TreeNode

void


optional onToggle?: (node, expanded) => void

Defined in: react/components/data/tree.tsx:26

A node was expanded/collapsed.

TreeNode

boolean

void


optional ref?: Ref<Widget>

Defined in: react/components/types.ts:30

Captures the underlying widget instance (React 19 ref-as-prop). Defaults to the base Widget; narrow it with a cast when you need a subclass field, e.g. ref={inputRef as React.Ref<InputWidget>}.

ComponentProps.ref


optional rowHeight?: number

Defined in: react/components/data/tree.tsx:12

Height of each row in cells.


optional selectedId?: string | null

Defined in: react/components/data/tree.tsx:16

Selected node id, or null.


optional showGuides?: boolean

Defined in: react/components/data/tree.tsx:18

Draw a dotted vertical guide line at each indentation level.


optional style?: WidgetStyles

Defined in: react/components/types.ts:32

Inline styles for this widget — see the Styling guide.

ComponentProps.style


optional theme?: string

Defined in: react/components/types.ts:34

Re-theme this subtree; descendants resolve $tokens against it.

ComponentProps.theme