TreeItem
An item within a tree hierarchy that can contain other items.
Code
<script lang="ts">
import { TreeItem } from '@geoffcox/sterling-svelte';
</script>
<TreeItem label="sterling-svelte" value="item" />
Members
| Property Name | Type | Default | Comment |
---|
| disabled | boolean | null | undefined | false |
| icon | Snippet | undefined | undefined |
| label | string | Snippet | undefined | undefined |
| value | string | |
| Method Name | Parameters | Return Type | Comment |
---|
| collapse | | |
| expand | | |
| select | | |
| selectParent | | |
| selectPrevious | | |
| selectNext | | |
| toggleExpanded | | |
Considerations
- A tree item is identified by having data-value and role="treeitem" properties.
- Includes HTMLDivElement props, events, and methods.
Anatomy
tree-item (div)
item (div)
icon (Snippet)
label (string | Snippet)
children (Snippet)