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

Property Type Description
childrenEl HTMLElement Container element for the child items of this collapsible node.
collapsed boolean Current collapsed state of tree item.
collapseEl HTMLElement | null Element for the collapse/expand toggle indicator, or null if not rendered.
collapsible boolean Whether tree item is able to be collapsed or not.
coverEl HTMLElement Overlay element covering the tree item, used for visual effects.
(Inherited from TreeItem)
innerEl HTMLElement Inner container element holding the tree item content.
(Inherited from TreeItem)
selfEl HTMLElement The main element representing this tree item in the DOM.
(Inherited from TreeItem)

Methods

Method Returns Description
onCollapseClick(event) void Execute collapse functionality on mouse click.
onSelfClick(event) void Execute item functionality on clicking tree item.
(Inherited from TreeItem)
setClickable(value) void Set clickable state of tree item.
(Inherited from TreeItem)
setCollapsed(value, animate?) Promise<undefined> Set collapsed state of tree item.
setCollapsible(value) void Set 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: