Skip to content
Entangle UI v0.13.0

TreeView

TreeView(__namedParameters): Element

Defined in: src/components/controls/TreeView/TreeView.tsx:36

A hierarchical collapsible tree for displaying and managing nested data.

Supports multi-selection, keyboard navigation, inline renaming, and custom node rendering. The most iconic editor panel — scene hierarchy, file browser, layer stack.

string

string

string

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

Booleanish

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

"none" | "inline" | "both" | "list"

Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.

string

Defines a string value that labels the current element, which is intended to be converted into Braille.

See

aria-label.

string

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.

See

aria-roledescription.

Booleanish

boolean | "mixed" | "false" | "true"

Indicates the current “checked” state of checkboxes, radio buttons, and other widgets.

See

  • aria-pressed
  • aria-selected.

number

Defines the total number of columns in a table, grid, or treegrid.

See

aria-colindex.

number

Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid.

See

  • aria-colcount
  • aria-colspan.

string

Defines a human readable text alternative of aria-colindex.

See

aria-rowindextext.

number

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.

See

  • aria-colindex
  • aria-rowspan.

string

Identifies the element (or elements) whose contents or presence are controlled by the current element.

See

aria-owns.

boolean | "location" | "page" | "false" | "true" | "step" | "date" | "time"

Indicates the element that represents the current item within a container or set of related elements.

string

Identifies the element (or elements) that describes the object.

See

aria-labelledby

string

Defines a string value that describes or annotates the current element.

See

related aria-describedby.

string

Identifies the element that provides a detailed, extended description for the object.

See

aria-describedby.

Booleanish

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

See

  • aria-hidden
  • aria-readonly.

"none" | "link" | "copy" | "move" | "execute" | "popup"

Indicates what functions can be performed when a dragged object is released on the drop target.

string

Identifies the element that provides an error message for the object.

See

  • aria-invalid
  • aria-describedby.

Booleanish

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

string

Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.

Booleanish

Indicates an element’s “grabbed” state in a drag-and-drop operation.

boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree"

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

Booleanish

Indicates whether the element is exposed to an accessibility API.

See

aria-disabled.

boolean | "false" | "true" | "grammar" | "spelling"

Indicates the entered value does not conform to the format expected by the application.

See

aria-errormessage.

string

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

string

Defines a string value that labels the current element.

See

aria-labelledby.

string

Identifies the element (or elements) that labels the current element.

See

aria-describedby.

number

Defines the hierarchical level of an element within a structure.

"off" | "assertive" | "polite"

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

Booleanish

Indicates whether an element is modal when displayed.

Booleanish

Indicates whether a text box accepts multiple lines of input or only a single line.

Booleanish

Indicates that the user may select more than one item from the current selectable descendants.

"horizontal" | "vertical"

Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.

string

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.

See

aria-controls.

string

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

number

Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

See

aria-setsize.

boolean | "mixed" | "false" | "true"

Indicates the current “pressed” state of toggle buttons.

See

  • aria-checked
  • aria-selected.

Booleanish

Indicates that the element is not editable, but is otherwise operable.

See

aria-disabled.

"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

See

aria-atomic.

Booleanish

Indicates that user input is required on the element before a form may be submitted.

string

Defines a human-readable, author-localized description for the role of an element.

number

Defines the total number of rows in a table, grid, or treegrid.

See

aria-rowindex.

number

Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.

See

  • aria-rowcount
  • aria-rowspan.

string

Defines a human readable text alternative of aria-rowindex.

See

aria-colindextext.

number

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

See

  • aria-rowindex
  • aria-colspan.

Booleanish

Indicates the current “selected” state of various widgets.

See

  • aria-checked
  • aria-pressed.

number

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

See

aria-posinset.

"none" | "ascending" | "descending" | "other"

Indicates if items in a table or grid are sorted in ascending or descending order.

number

Defines the maximum allowed value for a range widget.

number

Defines the minimum allowed value for a range widget.

number

Defines the current value for a range widget.

See

aria-valuetext.

string

Defines the human readable text alternative of aria-valuenow for a range widget.

"none" | string & object | "off" | "on" | "sentences" | "words" | "characters"

string

boolean

string

ReactNode

string

Additional CSS class names

string

string

"inherit" | Booleanish | "plaintext-only"

string

{ __html: string | TrustedHTML; }

string | TrustedHTML

string

boolean

string[]

Default expanded node IDs (uncontrolled).

string[]

Default selected node IDs (uncontrolled).

string | number | readonly string[]

string

Booleanish

string | null

Id of the node currently highlighted as an active drop target. The matching row gets a data-drop-target="true" attribute and an accent highlight. Pair with the onNodeDrag* / onNodeDrop callbacks to build drag-and-drop on top of the tree (see FileTree). null/undefined means no active target.

ReactNode

Empty state content when nodes array is empty.

"search" | "next" | "enter" | "done" | "go" | "previous" | "send"

string[]

Expanded node IDs (controlled).

boolean = false

Whether clicking anywhere on a parent node’s row toggles its expansion (not just the chevron). Leaf nodes are unaffected.

Default

false

boolean = false

Whether to expand parent nodes when they are selected.

Default

false

string

See

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts

boolean

string

Unique identifier for the component

number = 16

Indentation per depth level in pixels.

Default

16

boolean

See

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert

any

"text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal"

Hints at the type of data that might be entered by the user while editing the element or its contents

See

https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute

string

Specify that a standard HTML element should behave like a defined custom built-in element

See

https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is

string

string

string

boolean

string

string

string | number

Maximum height before scrolling.

TreeNodeData[]

Tree data — array of root-level nodes.

string

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

AnimationEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

InputEventHandler<HTMLDivElement>

InputEventHandler<HTMLDivElement>

ToggleEventHandler<HTMLDivElement>

FocusEventHandler<HTMLDivElement>

FocusEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ChangeEventHandler<HTMLDivElement, Element>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

CompositionEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

ClipboardEventHandler<HTMLDivElement>

ClipboardEventHandler<HTMLDivElement>

ClipboardEventHandler<HTMLDivElement>

ClipboardEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

DragEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

(expandedIds) => void

Fired when expanded nodes change.

FocusEventHandler<HTMLDivElement>

FocusEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

InputEventHandler<HTMLDivElement>

InputEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

KeyboardEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

MouseEventHandler<HTMLDivElement>

(node, event) => void

Fired when a node is clicked.

(node, event) => void

Fired when a node is right-clicked.

(node, event) => void

Fired when a node is double-clicked.

(node, event) => void

Fired on dragleave from a node row.

(node, event) => void

Fired on dragover over a node row. Call event.preventDefault() to mark the row as a valid drop target (so a subsequent drop fires).

(node, event) => void

Fired on drop onto a node row.

(nodeId, newLabel) => void

Fired when a node is renamed.

ClipboardEventHandler<HTMLDivElement>

ClipboardEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

PointerEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

UIEventHandler<HTMLDivElement>

UIEventHandler<HTMLDivElement>

UIEventHandler<HTMLDivElement>

UIEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

(selectedIds) => void

Fired when selected nodes change.

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

SubmitEventHandler<HTMLDivElement>

SubmitEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ToggleEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TouchEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

TransitionEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

ReactEventHandler<HTMLDivElement>

WheelEventHandler<HTMLDivElement>

WheelEventHandler<HTMLDivElement>

string

See

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part

"" | "auto" | "manual" | "hint"

string

"toggle" | "hide" | "show"

string

string

string

Ref<HTMLDivElement>

string

boolean = false

Whether to allow inline renaming (double-click on label).

Default

false

(node, state) => ReactNode

Custom render function for trailing actions (right side of node).

(node, state) => ReactNode

Custom render function for node content.

string

number

string

AriaRole

string

string[]

Selected node IDs (controlled).

TreeSelectionMode = 'single'

Selection mode.

Default

"single"

boolean = true

Whether to show expand/collapse chevrons for parent nodes.

Default

true

boolean = false

Whether to show connecting guide lines.

Default

false

Size = 'md'

Tree node size.

Default

"md"

string

Booleanish

CSSProperties

Custom inline styles

boolean

boolean

number

string

Test identifier for automated testing

string

"yes" | "no"

string

"off" | "on"

string

Element

const nodes = [
{ id: '1', label: 'Root', children: [
{ id: '1.1', label: 'Child A' },
{ id: '1.2', label: 'Child B' },
]},
];
<TreeView nodes={nodes} onSelectionChange={setSelected} />