Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeProps<T>

Type parameters

Hierarchy

Index

Properties

Methods

Properties

Optional about

about: string

Optional accessKey

accessKey: string

Optional aria-activedescendant

aria-activedescendant: string

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

Optional aria-atomic

aria-atomic: boolean | "true" | "false"

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.

Optional aria-autocomplete

aria-autocomplete: "list" | "none" | "inline" | "both"

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.

Optional aria-busy

aria-busy: boolean | "true" | "false"

Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.

Optional aria-checked

aria-checked: boolean | "true" | "false" | "mixed"

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

see

aria-pressed @see aria-selected.

Optional aria-colcount

aria-colcount: number

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

see

aria-colindex.

Optional aria-colindex

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 @see aria-colspan.

Optional aria-colspan

aria-colspan: number

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

see

aria-colindex @see aria-rowspan.

Optional aria-controls

aria-controls: string

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

see

aria-owns.

Optional aria-current

aria-current: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time"

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

Optional aria-describedby

aria-describedby: string

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

see

aria-labelledby

Optional aria-details

aria-details: string

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

see

aria-describedby.

Optional aria-disabled

aria-disabled: boolean | "true" | "false"

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

see

aria-hidden @see aria-readonly.

Optional aria-dropeffect

aria-dropeffect: "link" | "none" | "copy" | "execute" | "move" | "popup"

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

deprecated

in ARIA 1.1

Optional aria-errormessage

aria-errormessage: string

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

see

aria-invalid @see aria-describedby.

Optional aria-expanded

aria-expanded: boolean | "true" | "false"

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

Optional aria-flowto

aria-flowto: 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.

Optional aria-grabbed

aria-grabbed: boolean | "true" | "false"

Indicates an element's "grabbed" state in a drag-and-drop operation.

deprecated

in ARIA 1.1

Optional aria-haspopup

aria-haspopup: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree"

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

Optional aria-hidden

aria-hidden: boolean | "true" | "false"

Indicates whether the element is exposed to an accessibility API.

see

aria-disabled.

Optional aria-invalid

aria-invalid: boolean | "true" | "false" | "grammar" | "spelling"

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

see

aria-errormessage.

Optional aria-keyshortcuts

aria-keyshortcuts: string

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

Optional aria-label

aria-label: string

An optional label string that describes this tree. Either this or the aria-labelledby prop are required for a11y.

Optional aria-labelledby

aria-labelledby: string

An optional id that points to an element that labels this tree. Either this or the aria-label prop are required for a11y.

Optional aria-level

aria-level: number

Defines the hierarchical level of an element within a structure.

Optional aria-live

aria-live: "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.

Optional aria-modal

aria-modal: boolean | "true" | "false"

Indicates whether an element is modal when displayed.

Optional aria-multiline

aria-multiline: boolean | "true" | "false"

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

Optional aria-multiselectable

aria-multiselectable: boolean | "true" | "false"

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

Optional aria-orientation

aria-orientation: "horizontal" | "vertical"

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

Optional aria-owns

aria-owns: 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.

Optional aria-placeholder

aria-placeholder: 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.

Optional aria-posinset

aria-posinset: 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.

Optional aria-pressed

aria-pressed: boolean | "true" | "false" | "mixed"

Indicates the current "pressed" state of toggle buttons.

see

aria-checked @see aria-selected.

Optional aria-readonly

aria-readonly: boolean | "true" | "false"

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

see

aria-disabled.

Optional aria-relevant

aria-relevant: "text" | "additions" | "additions removals" | "additions text" | "all" | "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.

Optional aria-required

aria-required: boolean | "true" | "false"

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

Optional aria-roledescription

aria-roledescription: string

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

Optional aria-rowcount

aria-rowcount: number

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

see

aria-rowindex.

Optional aria-rowindex

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 @see aria-rowspan.

Optional aria-rowspan

aria-rowspan: number

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

see

aria-rowindex @see aria-colspan.

Optional aria-selected

aria-selected: boolean | "true" | "false"

Indicates the current "selected" state of various widgets.

see

aria-checked @see aria-pressed.

Optional aria-setsize

aria-setsize: 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.

Optional aria-sort

aria-sort: "none" | "ascending" | "descending" | "other"

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

Optional aria-valuemax

aria-valuemax: number

Defines the maximum allowed value for a range widget.

Optional aria-valuemin

aria-valuemin: number

Defines the minimum allowed value for a range widget.

Optional aria-valuenow

aria-valuenow: number

Defines the current value for a range widget.

see

aria-valuetext.

Optional aria-valuetext

aria-valuetext: string

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

Optional autoCapitalize

autoCapitalize: string

Optional autoCorrect

autoCorrect: string

Optional autoSave

autoSave: string

Optional children

children: ReactNode

Optional className

className: string

Optional color

color: string

Optional contentEditable

contentEditable: Booleanish | "inherit"

Optional contextMenu

contextMenu: string

Optional dangerouslySetInnerHTML

dangerouslySetInnerHTML: { __html: string }

Type declaration

  • __html: string

data

data: TreeData<T>

The data to render within the tree.

Optional datatype

datatype: string

Optional defaultChecked

defaultChecked: boolean

Optional defaultValue

defaultValue: string | number | readonly string[]

Optional dense

dense: boolean

Boolean if the dense spec should be applied to the list.

Optional dir

dir: string

Optional draggable

draggable: Booleanish

expandedIds

expandedIds: ExpandedIds

The list of expanded ids within the tree. These ids should reference itemIds for tree items.

Optional expanderIcon

expanderIcon: ReactNode

The icon to show within each item within the tree that helps show that there are child items.

NOTE: This will override the rightAddon prop if defined on each item by default so they can't be used. If the expanderLeft prop is enabled, the leftAddon will be overridden instead.

Optional expanderLeft

expanderLeft: boolean

Boolean if the expander icon should appear to the left instead of the right.

Optional getItemProps

getItemProps: GetItemProps<T>
see

GetItemProps

Optional hidden

hidden: boolean

Optional horizontal

horizontal: boolean

Boolean if the list should appear horizontally instead of vertically.

id

id: string

The id for the tree element. This is required for a lot of accessibility features.

Optional inlist

inlist: any

Optional inputMode

inputMode: "none" | "search" | "text" | "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

Optional is

is: 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

Optional itemID

itemID: string

Optional itemProp

itemProp: string

Optional itemRef

itemRef: string

Optional itemRenderer

itemRenderer: TreeItemRenderer<T>

A function that gets called to render each TreeItem within the tree. This can be overridden if you need to add additional functionality around the TreeItem (such as drag and drop). The default behavior is to extract the ListItem props:

  • leftAddon
  • leftAddonType
  • leftAddonPosition
  • rightAddon
  • rightAddonType
  • rightAddonPosition
  • children
  • to / href
  • isLink

and try to render as a TreeItem with those props. It will also override the expanderLeft and expanderIcon on the TreeItem with whatever was provided to the Tree component.

Optional itemScope

itemScope: boolean

Optional itemType

itemType: string

Optional labelKey

labelKey: string

The key to use to extract a renderable label from each tree item. This will be displayed in the DOM as the children in each tree item.

Optional lang

lang: string

Optional linkComponent

linkComponent: ElementType<any>

The component to use for any treeitem that has a to, href, or isLink attribute. This is a nice way to be able to update treeitems to be links instead of storing the contentComponent in the tree's data.

Optional multiSelect

multiSelect: boolean

Boolean if multiple items within the tree can be selected at once.

Optional onAbort

onAbort: ReactEventHandler<ListElement>

Optional onAbortCapture

onAbortCapture: ReactEventHandler<ListElement>

Optional onAnimationEnd

onAnimationEnd: AnimationEventHandler<ListElement>

Optional onAnimationEndCapture

onAnimationEndCapture: AnimationEventHandler<ListElement>

Optional onAnimationIteration

onAnimationIteration: AnimationEventHandler<ListElement>

Optional onAnimationIterationCapture

onAnimationIterationCapture: AnimationEventHandler<ListElement>

Optional onAnimationStart

onAnimationStart: AnimationEventHandler<ListElement>

Optional onAnimationStartCapture

onAnimationStartCapture: AnimationEventHandler<ListElement>

Optional onAuxClick

onAuxClick: MouseEventHandler<ListElement>

Optional onAuxClickCapture

onAuxClickCapture: MouseEventHandler<ListElement>

Optional onBeforeInput

onBeforeInput: FormEventHandler<ListElement>

Optional onBeforeInputCapture

onBeforeInputCapture: FormEventHandler<ListElement>

Optional onBlur

onBlur: FocusEventHandler<ListElement>

Optional onBlurCapture

onBlurCapture: FocusEventHandler<ListElement>

Optional onCanPlay

onCanPlay: ReactEventHandler<ListElement>

Optional onCanPlayCapture

onCanPlayCapture: ReactEventHandler<ListElement>

Optional onCanPlayThrough

onCanPlayThrough: ReactEventHandler<ListElement>

Optional onCanPlayThroughCapture

onCanPlayThroughCapture: ReactEventHandler<ListElement>

Optional onChange

onChange: FormEventHandler<ListElement>

Optional onChangeCapture

onChangeCapture: FormEventHandler<ListElement>

Optional onClick

onClick: MouseEventHandler<ListElement>

Optional onClickCapture

onClickCapture: MouseEventHandler<ListElement>

Optional onCompositionEnd

onCompositionEnd: CompositionEventHandler<ListElement>

Optional onCompositionEndCapture

onCompositionEndCapture: CompositionEventHandler<ListElement>

Optional onCompositionStart

onCompositionStart: CompositionEventHandler<ListElement>

Optional onCompositionStartCapture

onCompositionStartCapture: CompositionEventHandler<ListElement>

Optional onCompositionUpdate

onCompositionUpdate: CompositionEventHandler<ListElement>

Optional onCompositionUpdateCapture

onCompositionUpdateCapture: CompositionEventHandler<ListElement>

Optional onContextMenu

onContextMenu: MouseEventHandler<ListElement>

Optional onContextMenuCapture

onContextMenuCapture: MouseEventHandler<ListElement>

Optional onCopy

onCopy: ClipboardEventHandler<ListElement>

Optional onCopyCapture

onCopyCapture: ClipboardEventHandler<ListElement>

Optional onCut

onCut: ClipboardEventHandler<ListElement>

Optional onCutCapture

onCutCapture: ClipboardEventHandler<ListElement>

Optional onDoubleClick

onDoubleClick: MouseEventHandler<ListElement>

Optional onDoubleClickCapture

onDoubleClickCapture: MouseEventHandler<ListElement>

Optional onDrag

onDrag: DragEventHandler<ListElement>

Optional onDragCapture

onDragCapture: DragEventHandler<ListElement>

Optional onDragEnd

onDragEnd: DragEventHandler<ListElement>

Optional onDragEndCapture

onDragEndCapture: DragEventHandler<ListElement>

Optional onDragEnter

onDragEnter: DragEventHandler<ListElement>

Optional onDragEnterCapture

onDragEnterCapture: DragEventHandler<ListElement>

Optional onDragExit

onDragExit: DragEventHandler<ListElement>

Optional onDragExitCapture

onDragExitCapture: DragEventHandler<ListElement>

Optional onDragLeave

onDragLeave: DragEventHandler<ListElement>

Optional onDragLeaveCapture

onDragLeaveCapture: DragEventHandler<ListElement>

Optional onDragOver

onDragOver: DragEventHandler<ListElement>

Optional onDragOverCapture

onDragOverCapture: DragEventHandler<ListElement>

Optional onDragStart

onDragStart: DragEventHandler<ListElement>

Optional onDragStartCapture

onDragStartCapture: DragEventHandler<ListElement>

Optional onDrop

onDrop: DragEventHandler<ListElement>

Optional onDropCapture

onDropCapture: DragEventHandler<ListElement>

Optional onDurationChange

onDurationChange: ReactEventHandler<ListElement>

Optional onDurationChangeCapture

onDurationChangeCapture: ReactEventHandler<ListElement>

Optional onEmptied

onEmptied: ReactEventHandler<ListElement>

Optional onEmptiedCapture

onEmptiedCapture: ReactEventHandler<ListElement>

Optional onEncrypted

onEncrypted: ReactEventHandler<ListElement>

Optional onEncryptedCapture

onEncryptedCapture: ReactEventHandler<ListElement>

Optional onEnded

onEnded: ReactEventHandler<ListElement>

Optional onEndedCapture

onEndedCapture: ReactEventHandler<ListElement>

Optional onError

onError: ReactEventHandler<ListElement>

Optional onErrorCapture

onErrorCapture: ReactEventHandler<ListElement>

Optional onFocus

onFocus: FocusEventHandler<ListElement>

Optional onFocusCapture

onFocusCapture: FocusEventHandler<ListElement>

Optional onGotPointerCapture

onGotPointerCapture: PointerEventHandler<ListElement>

Optional onGotPointerCaptureCapture

onGotPointerCaptureCapture: PointerEventHandler<ListElement>

Optional onInput

onInput: FormEventHandler<ListElement>

Optional onInputCapture

onInputCapture: FormEventHandler<ListElement>

Optional onInvalid

onInvalid: FormEventHandler<ListElement>

Optional onInvalidCapture

onInvalidCapture: FormEventHandler<ListElement>

Optional onKeyDown

onKeyDown: KeyboardEventHandler<ListElement>

Optional onKeyDownCapture

onKeyDownCapture: KeyboardEventHandler<ListElement>

Optional onKeyPress

onKeyPress: KeyboardEventHandler<ListElement>

Optional onKeyPressCapture

onKeyPressCapture: KeyboardEventHandler<ListElement>

Optional onKeyUp

onKeyUp: KeyboardEventHandler<ListElement>

Optional onKeyUpCapture

onKeyUpCapture: KeyboardEventHandler<ListElement>

Optional onLoad

onLoad: ReactEventHandler<ListElement>

Optional onLoadCapture

onLoadCapture: ReactEventHandler<ListElement>

Optional onLoadStart

onLoadStart: ReactEventHandler<ListElement>

Optional onLoadStartCapture

onLoadStartCapture: ReactEventHandler<ListElement>

Optional onLoadedData

onLoadedData: ReactEventHandler<ListElement>

Optional onLoadedDataCapture

onLoadedDataCapture: ReactEventHandler<ListElement>

Optional onLoadedMetadata

onLoadedMetadata: ReactEventHandler<ListElement>

Optional onLoadedMetadataCapture

onLoadedMetadataCapture: ReactEventHandler<ListElement>

Optional onLostPointerCapture

onLostPointerCapture: PointerEventHandler<ListElement>

Optional onLostPointerCaptureCapture

onLostPointerCaptureCapture: PointerEventHandler<ListElement>

Optional onMouseDown

onMouseDown: MouseEventHandler<ListElement>

Optional onMouseDownCapture

onMouseDownCapture: MouseEventHandler<ListElement>

Optional onMouseEnter

onMouseEnter: MouseEventHandler<ListElement>

Optional onMouseLeave

onMouseLeave: MouseEventHandler<ListElement>

Optional onMouseMove

onMouseMove: MouseEventHandler<ListElement>

Optional onMouseMoveCapture

onMouseMoveCapture: MouseEventHandler<ListElement>

Optional onMouseOut

onMouseOut: MouseEventHandler<ListElement>

Optional onMouseOutCapture

onMouseOutCapture: MouseEventHandler<ListElement>

Optional onMouseOver

onMouseOver: MouseEventHandler<ListElement>

Optional onMouseOverCapture

onMouseOverCapture: MouseEventHandler<ListElement>

Optional onMouseUp

onMouseUp: MouseEventHandler<ListElement>

Optional onMouseUpCapture

onMouseUpCapture: MouseEventHandler<ListElement>

Optional onPaste

onPaste: ClipboardEventHandler<ListElement>

Optional onPasteCapture

onPasteCapture: ClipboardEventHandler<ListElement>

Optional onPause

onPause: ReactEventHandler<ListElement>

Optional onPauseCapture

onPauseCapture: ReactEventHandler<ListElement>

Optional onPlay

onPlay: ReactEventHandler<ListElement>

Optional onPlayCapture

onPlayCapture: ReactEventHandler<ListElement>

Optional onPlaying

onPlaying: ReactEventHandler<ListElement>

Optional onPlayingCapture

onPlayingCapture: ReactEventHandler<ListElement>

Optional onPointerCancel

onPointerCancel: PointerEventHandler<ListElement>

Optional onPointerCancelCapture

onPointerCancelCapture: PointerEventHandler<ListElement>

Optional onPointerDown

onPointerDown: PointerEventHandler<ListElement>

Optional onPointerDownCapture

onPointerDownCapture: PointerEventHandler<ListElement>

Optional onPointerEnter

onPointerEnter: PointerEventHandler<ListElement>

Optional onPointerEnterCapture

onPointerEnterCapture: PointerEventHandler<ListElement>

Optional onPointerLeave

onPointerLeave: PointerEventHandler<ListElement>

Optional onPointerLeaveCapture

onPointerLeaveCapture: PointerEventHandler<ListElement>

Optional onPointerMove

onPointerMove: PointerEventHandler<ListElement>

Optional onPointerMoveCapture

onPointerMoveCapture: PointerEventHandler<ListElement>

Optional onPointerOut

onPointerOut: PointerEventHandler<ListElement>

Optional onPointerOutCapture

onPointerOutCapture: PointerEventHandler<ListElement>

Optional onPointerOver

onPointerOver: PointerEventHandler<ListElement>

Optional onPointerOverCapture

onPointerOverCapture: PointerEventHandler<ListElement>

Optional onPointerUp

onPointerUp: PointerEventHandler<ListElement>

Optional onPointerUpCapture

onPointerUpCapture: PointerEventHandler<ListElement>

Optional onProgress

onProgress: ReactEventHandler<ListElement>

Optional onProgressCapture

onProgressCapture: ReactEventHandler<ListElement>

Optional onRateChange

onRateChange: ReactEventHandler<ListElement>

Optional onRateChangeCapture

onRateChangeCapture: ReactEventHandler<ListElement>

Optional onReset

onReset: FormEventHandler<ListElement>

Optional onResetCapture

onResetCapture: FormEventHandler<ListElement>

Optional onScroll

onScroll: UIEventHandler<ListElement>

Optional onScrollCapture

onScrollCapture: UIEventHandler<ListElement>

Optional onSeeked

onSeeked: ReactEventHandler<ListElement>

Optional onSeekedCapture

onSeekedCapture: ReactEventHandler<ListElement>

Optional onSeeking

onSeeking: ReactEventHandler<ListElement>

Optional onSeekingCapture

onSeekingCapture: ReactEventHandler<ListElement>

Optional onSelect

onSelect: ReactEventHandler<ListElement>

Optional onSelectCapture

onSelectCapture: ReactEventHandler<ListElement>

Optional onStalled

onStalled: ReactEventHandler<ListElement>

Optional onStalledCapture

onStalledCapture: ReactEventHandler<ListElement>

Optional onSubmit

onSubmit: FormEventHandler<ListElement>

Optional onSubmitCapture

onSubmitCapture: FormEventHandler<ListElement>

Optional onSuspend

onSuspend: ReactEventHandler<ListElement>

Optional onSuspendCapture

onSuspendCapture: ReactEventHandler<ListElement>

Optional onTimeUpdate

onTimeUpdate: ReactEventHandler<ListElement>

Optional onTimeUpdateCapture

onTimeUpdateCapture: ReactEventHandler<ListElement>

Optional onTouchCancel

onTouchCancel: TouchEventHandler<ListElement>

Optional onTouchCancelCapture

onTouchCancelCapture: TouchEventHandler<ListElement>

Optional onTouchEnd

onTouchEnd: TouchEventHandler<ListElement>

Optional onTouchEndCapture

onTouchEndCapture: TouchEventHandler<ListElement>

Optional onTouchMove

onTouchMove: TouchEventHandler<ListElement>

Optional onTouchMoveCapture

onTouchMoveCapture: TouchEventHandler<ListElement>

Optional onTouchStart

onTouchStart: TouchEventHandler<ListElement>

Optional onTouchStartCapture

onTouchStartCapture: TouchEventHandler<ListElement>

Optional onTransitionEnd

onTransitionEnd: TransitionEventHandler<ListElement>

Optional onTransitionEndCapture

onTransitionEndCapture: TransitionEventHandler<ListElement>

Optional onVolumeChange

onVolumeChange: ReactEventHandler<ListElement>

Optional onVolumeChangeCapture

onVolumeChangeCapture: ReactEventHandler<ListElement>

Optional onWaiting

onWaiting: ReactEventHandler<ListElement>

Optional onWaitingCapture

onWaitingCapture: ReactEventHandler<ListElement>

Optional onWheel

onWheel: WheelEventHandler<ListElement>

Optional onWheelCapture

onWheelCapture: WheelEventHandler<ListElement>

Optional ordered

ordered: boolean

Boolean if the list's order is important. This will update the list to be rendered as an <ol> instead of <ul>.

Optional placeholder

placeholder: string

Optional prefix

prefix: string

Optional property

property: string

Optional radioGroup

radioGroup: string

Optional resource

resource: string

Optional results

results: number

Optional role

role: AriaRole

The role is set to "none" by default for lists screen readers announce lists differently than other elements on the page. Since the major use-case for lists is to contain clickable items, setting this to "none" fixes this issue.

Optional rootId

rootId: null | string

An optional id to use to determine the root items within the tree. You'll most likely want to keep this as the default of null, but it can also be used if you have a different identifier for root items.

Optional security

security: string

selectedIds

selectedIds: SelectedIds

The list of selected ids within the tree. If you only want to allow a single item to be selected at a time within a tree, keep this as either an empty list (no selections) or a single itemId.

Optional slot

slot: string

Optional sort

see

TreeItemSorter

Optional spellCheck

spellCheck: Booleanish

Optional style

style: CSSProperties

Optional suppressContentEditableWarning

suppressContentEditableWarning: boolean

Optional suppressHydrationWarning

suppressHydrationWarning: boolean

Optional tabIndex

tabIndex: number

Optional title

title: string

Optional translate

translate: "yes" | "no"

Optional typeof

typeof: string

Optional unselectable

unselectable: "on" | "off"

Optional valueKey

valueKey: string

The key to use to extract a text string from each tree item. This is used for keyboard accessibility and being able to "search" the tree for items starting with the typed letters.

Optional vocab

vocab: string

Methods

Optional getItemLabel

  • getItemLabel(item: T, labelKey: string): ReactNode
  • A function to extract the renderable label from each tree item. The default behavior will be to just return item[labelKey].

    Parameters

    • item: T
    • labelKey: string

    Returns ReactNode

Optional getItemValue

  • getItemValue(item: T, valueKey: string): string
  • A function to extract the text string from each tree item. The default behavior will be to return the item[valueKey] and stringify it.

    Parameters

    • item: T
    • valueKey: string

    Returns string

onItemExpansion

  • onItemExpansion(itemId: string, expanded: boolean): void

onItemSelect

  • onItemSelect(itemId: string): void
  • A function to call that will update the selectedIds to include itemId of the newly selected tree item. This will be triggered when:

    • the user clicks a tree item with mouse or touch
    • user presses the space or enter key while keyboard focusing a tree item

    Note: If you are using the useTreeItemSelection hook, this will always cause the selectedIds to be a list of just the selected itemId unless the multiSelect (second argument) is enabled.

    Parameters

    • itemId: string

    Returns void

onMultiItemExpansion

onMultiItemSelect

  • A function to call that will update the selectedIds for "batch" selection updates. This will always be called with a unique list of itemIds that contained the previous itemIds including the new itemIds. This will only be called when the multiSelect prop has been enabled and:

    • the user Shift + Clicks items within the tree
    • triggers "select-to" keyboard functionality with Control+Shift+Home or Control+Shift+End

    Parameters

    Returns void

Generated using TypeDoc