The ui5-tree-item
represents a node in a tree structure, shown as a ui5-list
.
This is the item to use inside a ui5-tree
.
You can represent an arbitrary tree structure by recursively nesting tree items.
ES6 Module Importβ
import "@ui5/webcomponents/dist/TreeItem.js";
Propertiesβ
Description | Defines the text of the tree item. |
Type | string | undefined |
Default | undefined |
additionalTextβ
Description | Defines the additionalText , displayed in the end of the tree item. |
Type | string | undefined |
Default | undefined |
Since | 1.0.0-rc.15 |
Description | If set, an icon will be displayed before the text of the tree list item. |
Type | string | undefined |
Default | undefined |
expandedβ
Description | Defines whether the tree list item will show a collapse or expand icon inside its toggle button. |
Type | boolean |
Default | false |
movableβ
Description | Defines whether the item is movable. |
Type | boolean |
Default | false |
Since | 2.0.0 |
indeterminateβ
Description | Defines whether the selection of a tree node is displayed as partially selected. Note: The indeterminate state can be set only programmatically and canβt be achieved by user interaction, meaning that the resulting visual state depends on the values of the indeterminate and selected properties: - If a tree node has both selected and indeterminate set to true , it is displayed as partially selected. - If a tree node has selected set to true and indeterminate set to false , it is displayed as selected. - If a tree node has selected set to false , it is displayed as not selected regardless of the value of the indeterminate property. Note: This property takes effect only when the ui5-tree is in Multiple mode. |
Type | boolean |
Default | false |
Since | 1.1.0 |
hasChildrenβ
Description | Defines whether the tree node has children, even if currently no other tree nodes are slotted inside. Note: This property is useful for showing big tree structures where not all nodes are initially loaded due to performance reasons. Set this to true for nodes you intend to load lazily, when the user clicks the expand button. It is not necessary to set this property otherwise. If a tree item has children, the expand button will be displayed anyway. |
Type | boolean |
Default | false |
additionalTextStateβ
Description | Defines the state of the additionalText . Available options are: "None" (by default), "Positive" , "Critical" , "Information" and "Negative" . |
Type | "None" | "Positive" | "Critical" | "Negative" | "Information" |
Default | "None" |
Since | 1.0.0-rc.15 |
accessibleNameβ
Description | Defines the accessible name of the component. |
Type | string | undefined |
Default | undefined |
Since | 1.8.0 |
Description | Defines the visual indication and behavior of the list items. Available options are Active (by default), Inactive , Detail and Navigation . Note: When set to Active or Navigation , the item will provide visual response upon press and hover, while with type Inactive and Detail - will not. |
Type | "Inactive" | "Active" | "Detail" | "Navigation" |
Default | "Active" |
accessibilityAttributesβ
Description | Defines the additional accessibility attributes that will be applied to the component. The following fields are supported: - ariaSetsize: Defines the number of items in the current set when not all items in the set are present in the DOM. Note: The value is an integer reflecting the number of items in the complete set. If the size of the entire set is unknown, set -1 . - ariaPosinset: Defines an element's number or position in the current set when not all items are present in the DOM. Note: The value is an integer greater than or equal to 1, and less than or equal to the size of the set when that size is known. |
Type | ListItemAccessibilityAttributes |
Default | |
Since | 1.15.0 |
navigatedβ
Description | The navigated state of the list item. If set to true , a navigation indicator is displayed at the end of the list item. |
Type | boolean |
Default | false |
Since | 1.10.0 |
Description | Defines the text of the tooltip that would be displayed for the list item. |
Type | string | undefined |
Default | undefined |
Since | 1.23.0 |
highlightβ
Description | Defines the highlight state of the list items. Available options are: "None" (by default), "Positive" , "Critical" , "Information" and "Negative" . |
Type | "None" | "Positive" | "Critical" | "Negative" | "Information" |
Default | "None" |
Since | 1.24 |
selectedβ
Description | Defines the selected state of the component. |
Type | boolean |
Default | false |
defaultβ
Description | Defines the items of the component. Note: Use ui5-tree-item or ui5-tree-item-custom |
Type | Array<TreeItemBase> |
Description | Defines the delete button, displayed in "Delete" mode. Note: While the slot allows custom buttons, to match design guidelines, please use the ui5-button component. Note: When the slot is not present, a built-in delete button will be displayed. |
Type | Array<IButton> |
Since | 1.9.0 |
detail-clickβ
Description | Fired when the user clicks on the detail button when type is Detail . |
Type | CustomEvent |
Bubbles | Yes |
Cancelable | No |
Methodsβ
Description | Call this method to manually switch the expanded state of a tree item. |
Return type | void |
CSS Partsβ
Name | Description |
---|
title | Used to style the title of the tree list item |
additionalText | Used to style the additionalText of the tree list item |
icon | Used to style the icon of the tree list item |