The tree allows users to represent hierarchical data in a tree-view structure, maintaining parent-child relationships, as well as to define static tree-view structure without a corresponding data model.

Element
igc-tree
Slots
default — Renders the tree items inside default slot.

The selection mode of the tree. A change clears the current selection.

selection: TreeSelection = 'none'

Defined in src/components/tree/tree.ts:89

Whether only one branch of the tree can be expanded at a time. When the user expands an item, the items outside its path collapse.

singleBranchExpand: boolean = false

Defined in src/components/tree/tree.ts:75

Whether a click on an item toggles its expanded state.

toggleNodeOnClick: boolean = false

Defined in src/components/tree/tree.ts:82

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: "igc-tree" = 'igc-tree'

Defined in src/components/tree/tree.ts:55

All items of the tree, in document order. Empty during server-side rendering.

get items(): IgcTreeItemComponent[]

Defined in src/components/tree/tree.ts:103

Returns IgcTreeItemComponent[]

Collapses all of the passed items. If no items are passed, collapses ALL items.

collapse(items: IgcTreeItemComponent[]): void

Defined in src/components/tree/tree.ts:235

Parameters

Returns void

Invoked when the component is added to the document's DOM.

In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.

``

Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().

connectedCallback(): void

Defined in src/components/tree/tree.ts:120

Returns void

Deselects the passed items. Without an argument, deselects all items. Emits no event.

deselect(items: IgcTreeItemComponent[]): void

Defined in src/components/tree/tree.ts:209

Parameters

Returns void

Expands all of the passed items. If no items are passed, expands ALL items.

expand(items: IgcTreeItemComponent[]): void

Defined in src/components/tree/tree.ts:221

Parameters

Returns void

Selects the passed items. Without an argument, selects all items. Emits no event.

select(items: IgcTreeItemComponent[]): void

Defined in src/components/tree/tree.ts:192

Parameters

Returns void