@jsvision/ui / TreeOptions
Interface: TreeOptions<T>
Defined in: ui/src/tree/tree.ts:23
Construction options for Tree.
Type Parameters
T
T
Properties
command?
optionalcommand?:string
Defined in: ui/src/tree/tree.ts:35
Command name emitted on activation, handled elsewhere; no built-in default.
expandedByDefault?
optionalexpandedByDefault?:boolean
Defined in: ui/src/tree/tree.ts:37
Seed every node that has children as expanded at construction (default false = all collapsed).
focused?
optionalfocused?:Signal<number>
Defined in: ui/src/tree/tree.ts:29
The focused (highlighted) flattened-visible index (default an internal signal at 0).
getText
getText: (
value) =>string
Defined in: ui/src/tree/tree.ts:27
Render a node's value to its row text.
Parameters
value
T
Returns
string
guides?
optionalguides?:boolean
Defined in: ui/src/tree/tree.ts:39
Draw the │├└─ connectors (default true); false = flat indent, markers unchanged.
markerStyle?
optionalmarkerStyle?:MarkerStyle
Defined in: ui/src/tree/tree.ts:46
The expand-marker style (default 'tv' — a faithful single +/─). 'brackets' draws [+]/[-] (pure ASCII, the most legible); 'triangle' draws ▸/▾ and falls back to 'brackets' on a terminal without Unicode. Only the marker column changes — indentation and connectors are identical across styles.
onSelect?
optionalonSelect?: (index,node) =>void
Defined in: ui/src/tree/tree.ts:33
Activation callback (Enter / text double-click); index is the flattened index, node the node.
Parameters
index
number
node
TreeNode<T>
Returns
void
roots
Defined in: ui/src/tree/tree.ts:25
The reactive forest of root nodes; a single-root tree is the 1-element case.
selected?
optionalselected?:Signal<number>
Defined in: ui/src/tree/tree.ts:31
The selected (chosen) flattened-visible index (default an internal signal at -1).