Tree
A hierarchy of items that can be expanded/collapsed and where a single item can be selected.
Code
<script lang="ts">
import { Tree } from '@geoffcox/sterling-svelte';
let expandedValues: string[] = [];
let selectedValue: string | undefined = undefined;
</script>
<Tree bind:expandedValues bind:selectedValue>
<!-- <TreeItem> ... -->
</List>
Members
| Property Name | Type | Default | Comment |
---|
| disabled | boolean | null | undefined | false |
| selectedValue | string | undefined | undefined |
| expandedValues | string[] | undefined | [ ] |
| onExpandCollapse | (expandedValues: string) => null | undefined |
| onSelect | (selectedValue: string) => null | undefined |
Considerations
- Includes HTMLDivElement props, events, and methods.
Anatomy
tree (<div>)
children (Snippet)