BetaPublic beta — Read the release notes
Documentation

Tree

Hierarchical tree view with expand/collapse.

Package
@solidiom/tree
Version
0.0.1-next.0
Status
stable

Generated from the package's public source.

API

Branchcomponent

@solidiom/tree — Headless tree view primitive. Parts: Root, Item, Branch, ItemIndicator.

                        Branch(props: TreeBranchProps): Element
                      

Props

class?
string

children: Element

View source

Itemcomponent

@solidiom/tree — Headless tree view primitive. Parts: Root, Item, Branch, ItemIndicator.

                        Item(props: TreeItemProps): Element
                      

Props

class?
string
disabled?
boolean — Whether this item is disabled.
id
string — Unique ID for this item.
ref?
(el: HTMLDivElement) => void
textValue?
string — Text value for typeahead matching.

children: Element

View source

ItemIndicatorcomponent

@solidiom/tree — Headless tree view primitive. Parts: Root, Item, Branch, ItemIndicator.

                        ItemIndicator(props: TreeItemIndicatorProps): Element
                      

Props

class?
string

children: Element

View source

Rootcomponent

@solidiom/tree — Headless tree view primitive. Parts: Root, Item, Branch, ItemIndicator.

                        Root(props: TreeRootProps): Element
                      

Props

class?
string
defaultExpandedIds?
Set<string> — Default expanded IDs for uncontrolled mode.
defaultSelectedIds?
Set<string> — Default selected IDs for uncontrolled mode.
expandedIds?
Accessor<Set<string>> — Controlled expanded IDs.
onExpandedChange?
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Called when expanded IDs change.
onSelectedChange?
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Called when selected IDs change.
ref?
(el: HTMLDivElement) => void
selectedIds?
Accessor<Set<string>> — Controlled selected IDs.
selectionMode?
SelectionMode — Selection mode: "single" (default) or "multiple".

children: Element

View source

SelectionModetype

Selection mode for the tree.

View source

TreeBranchPropsinterface

Props for a tree branch (group of nested items).

Props

class?
string

children: Element

View source

TreeContextValueinterface

Props

baseId
string — Generated base ID.
expandedIds
Accessor<Set<string>> — Set of currently expanded item IDs.
focusedId
Accessor<string | null> — Currently focused item ID.
registerItem
(item: TreeItemEntry) => () => void — Register a visible tree item for focus management. Returns cleanup.
requestExpandedChange
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Request expansion state change.
requestSelectedChange
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Request selection state change.
selectedIds
Accessor<Set<string>> — Set of currently selected item IDs.
selectionMode
SelectionMode — Selection mode.
setFocusedId
(id: string | null) => void — Set focus to an item by ID.
typeahead
Typeahead — Typeahead instance for character navigation.
visibleItems
Accessor<TreeItemEntry[]> — All registered visible items in DOM order.

View source

TreeItemEntryinterface

Registration entry for a tree item.

Props

depth
number
disabled
boolean
id
string
parentId
string | null
ref?
HTMLElement
textValue
string

View source

TreeItemIndicatorPropsinterface

Props for the tree item expand/collapse indicator.

Props

class?
string

children: Element

View source

TreeItemPropsinterface

Props for a tree item.

Props

class?
string
disabled?
boolean — Whether this item is disabled.
id
string — Unique ID for this item.
ref?
(el: HTMLDivElement) => void
textValue?
string — Text value for typeahead matching.

children: Element

View source

TreeReasontype

Reason for a tree state change.

View source

TreeRootPropsinterface

@solidiom/tree — Headless tree view primitive. Parts: Root, Item, Branch, ItemIndicator.

Props

class?
string
defaultExpandedIds?
Set<string> — Default expanded IDs for uncontrolled mode.
defaultSelectedIds?
Set<string> — Default selected IDs for uncontrolled mode.
expandedIds?
Accessor<Set<string>> — Controlled expanded IDs.
onExpandedChange?
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Called when expanded IDs change.
onSelectedChange?
(ids: Set<string>, details: ChangeDetails<TreeReason>) => void — Called when selected IDs change.
ref?
(el: HTMLDivElement) => void
selectedIds?
Accessor<Set<string>> — Controlled selected IDs.
selectionMode?
SelectionMode — Selection mode: "single" (default) or "multiple".

children: Element

View source