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.
Properties
Section titled "Properties"selection
Section titled "selection"The selection mode of the tree. A change clears the current selection.
selection: TreeSelection = 'none' Defined in src/components/tree/tree.ts:89
singleBranchExpand
Section titled "singleBranchExpand"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
toggleNodeOnClick
Section titled "toggleNodeOnClick"Whether a click on an item toggles its expanded state.
toggleNodeOnClick: boolean = false Defined in src/components/tree/tree.ts:82
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-tree" = 'igc-tree' Defined in src/components/tree/tree.ts:55
Accessors
Section titled "Accessors"items
Section titled "items"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[]
Methods
Section titled "Methods"collapse
Section titled "collapse"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
- items:
IgcTreeItemComponent[]
Returns void
connectedCallback
Section titled "connectedCallback"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
deselect
Section titled "deselect"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
- items:
IgcTreeItemComponent[]
Returns void
expand
Section titled "expand"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
- items:
IgcTreeItemComponent[]
Returns void
select
Section titled "select"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
- items:
IgcTreeItemComponent[]