Skip to content

TreeCollapsibleItem

Unofficial

A tree item that can be collapsed to hide its children.

Import:

import type { TreeCollapsibleItem } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface TreeCollapsibleItem extends TreeItem

Extends: TreeItem

Properties

PropertyTypeDescription
childrenElHTMLElementContainer element for the child items of this collapsible node.
collapsedbooleanCurrent collapsed state of tree item.
collapseElHTMLElement | nullElement for the collapse/expand toggle indicator, or null if not rendered.
collapsiblebooleanWhether tree item is able to be collapsed or not.
coverElHTMLElementOverlay element covering the tree item, used for visual effects.
(Inherited from TreeItem)
innerElHTMLElementInner container element holding the tree item content.
(Inherited from TreeItem)
selfElHTMLElementThe main element representing this tree item in the DOM.
(Inherited from TreeItem)

Methods

MethodReturnsDescription
onCollapseClick(event)voidExecute collapse functionality on mouse click.
onSelfClick(event)voidExecute item functionality on clicking tree item.
(Inherited from TreeItem)
setClickable(value)voidSet clickable state of tree item.
(Inherited from TreeItem)
setCollapsed(value, animate?)Promise<undefined>Set collapsed state of tree item.
setCollapsible(value)voidSet collapsible state of tree item.
toggleCollapsed(animate?)Promise<undefined>Toggle collapsed state of tree item.
updateCollapsed(animate?)Promise<undefined>Update the tree item's cover element.

Links to this page: