diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md
index 9b6b7acf..d85c882d 100644
--- a/COMPONENT_INDEX.md
+++ b/COMPONENT_INDEX.md
@@ -4753,15 +4753,19 @@ export interface TreeNode {
### Props
-| Prop name | Kind | Reactive | Type | Default value | Description |
-| :---------- | :--------------- | :------- | :------------------------------------------------------- | ---------------------- | --------------------------------------------------------------- |
-| expandedIds | let
| Yes | TreeNodeId[]
| []
| Set the node ids to be expanded |
-| selectedIds | let
| Yes | TreeNodeId[]
| []
| Set the node ids to be selected |
-| activeId | let
| Yes | TreeNodeId
| ""
| Set the current active node id
Only one node can be active |
-| children | let
| No | Array
| []
| Provide an array of children nodes to render |
-| size | let
| No | "default" | "compact"
| "default"
| Specify the TreeView size |
-| labelText | let
| No | string
| ""
| Specify the label text |
-| hideLabel | let
| No | boolean
| false
| Set to `true` to visually hide the label text |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :------------ | :-------------------- | :------- | :------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
+| expandedIds | let
| Yes | TreeNodeId[]
| []
| Set the node ids to be expanded |
+| selectedIds | let
| Yes | TreeNodeId[]
| []
| Set the node ids to be selected |
+| activeId | let
| Yes | TreeNodeId
| ""
| Set the current active node id
Only one node can be active |
+| children | let
| No | Array
| []
| Provide an array of children nodes to render |
+| size | let
| No | "default" | "compact"
| "default"
| Specify the TreeView size |
+| labelText | let
| No | string
| ""
| Specify the label text |
+| hideLabel | let
| No | boolean
| false
| Set to `true` to visually hide the label text |
+| expandAll | function
| No | () => void
| () => { expandedIds = [...nodeIds]; }
| Programmatically expand all nodes |
+| collapseAll | function
| No | () => void
| () => { expandedIds = []; }
| Programmatically collapse all nodes |
+| expandNodes | function
| No | (filterId?: (node: TreeNode) => boolean) => void
| () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }
| Programmatically expand a subset of nodes.
Expands all nodes if no argument is provided |
+| collapseNodes | function
| No | (filterId?: (node: TreeNode) => boolean) => void
| () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }
| Programmatically collapse a subset of nodes.
Collapses all nodes if no argument is provided |
### Slots
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 7435dbd5..0d746ed7 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -13163,6 +13163,50 @@
"isFunctionDeclaration": false,
"constant": false,
"reactive": false
+ },
+ {
+ "name": "expandAll",
+ "kind": "function",
+ "description": "Programmatically expand all nodes",
+ "type": "() => void",
+ "value": "() => { expandedIds = [...nodeIds]; }",
+ "isFunction": true,
+ "isFunctionDeclaration": true,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "collapseAll",
+ "kind": "function",
+ "description": "Programmatically collapse all nodes",
+ "type": "() => void",
+ "value": "() => { expandedIds = []; }",
+ "isFunction": true,
+ "isFunctionDeclaration": true,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "expandNodes",
+ "kind": "function",
+ "description": "Programmatically expand a subset of nodes.\nExpands all nodes if no argument is provided",
+ "type": "(filterId?: (node: TreeNode) => boolean) => void",
+ "value": "() => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }",
+ "isFunction": true,
+ "isFunctionDeclaration": true,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "collapseNodes",
+ "kind": "function",
+ "description": "Programmatically collapse a subset of nodes.\nCollapses all nodes if no argument is provided",
+ "type": "(filterId?: (node: TreeNode) => boolean) => void",
+ "value": "() => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }",
+ "isFunction": true,
+ "isFunctionDeclaration": true,
+ "constant": false,
+ "reactive": false
}
],
"slots": [
diff --git a/docs/src/pages/components/TreeView.svx b/docs/src/pages/components/TreeView.svx
index 4cd34e29..daaf5205 100644
--- a/docs/src/pages/components/TreeView.svx
+++ b/docs/src/pages/components/TreeView.svx
@@ -45,4 +45,34 @@ Expanded nodes can be set using `expandedIds`.
Initial multiple selected nodes can be set using `selectedIds`.
-