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 state of the tree.

selection: TreeSelection = 'none'

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

Whether a single or multiple of a parent's child items can be expanded.

singleBranchExpand: boolean = false

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

Whether clicking over nodes will change their expanded state or not.

toggleNodeOnClick: boolean = false

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

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

Returns all of the tree's items.

get items(): IgcTreeItemComponent[]

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

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

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

Returns void

Deselect all items if the items collection is empty. Otherwise, deselect the items in the items collection.

deselect(items: IgcTreeItemComponent[]): void

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

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

Parameters

Returns void

Select all items if the items collection is empty. Otherwise, select the items in the items collection.

select(items: IgcTreeItemComponent[]): void

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

Parameters

Returns void