NewPower Apps · canvas componentNavigation and layout✓ Tested in StudioMIT License
Tree view
Folders, categories or an org chart as a tree that opens and closes, from one flat table, in one gallery. Load children only when a node opens, mark the selected node, and save which nodes were open.
As it is when you paste it, with every input at its default.
Screen1
Files
Open: docs
Formulas on this screen
Set the same ones in Studio to try it the same way; there, each Notify shows its event in a banner, which this preview leaves out so nothing covers the component. The instance names are the ones Studio gives the first copy on a screen.
A web replica that behaves as the component does in Power Apps. In Studio it uses Microsoft's controls, which can look slightly different.
Add it in five steps
1In Power Apps Studio, open Settings > Updates and check that Modern controls and themes and Enhanced component properties are on.
2Open the Components tab in the tree view and select New component.
3Select an empty part of Studio, so the new component isn't selected.
4Copy the YAML on this page and press Ctrl+V. lcsTreeView appears with all its properties.
5On a screen, insert it from Insert > Custom > lcsTreeView.
What it needs
No premium licence: standard controls, no connectors
Modern controls and themes: on
Enhanced component properties: on
Tested in Power Apps Studio 3.26094.9 on October 11, 2026
Version 0.2.0
Properties (29)
Read from the component's own YAML, so they always match what you paste.
Inputs
Property
Kind
Type
Default
Nodes
Every node as one flat table: Key, ParentKey (blank for the top level), Label, Icon (a Fluent icon name, such as Folder) and HasChildren (true when it has children you load later).
Keys of the nodes open when the screen loads, separated by commas.
Input
Text
"docs"
CurrentKey
The Key of the node to mark as selected, from your app. Leave it blank and the tree marks the node last selected.
Input
Text
""
Title
The heading above the tree.
Input
Text
"Files"
ShowTitle
Shows the heading.
Input
Boolean
true
ShowIcons
Shows each node's icon: folders in amber, everything else in your colour.
Input
Boolean
true
ShowCounts
Shows how many children each open or closed folder has, once they're loaded.
Input
Boolean
true
ShowGuides
Draws thin lines that join each level to its parent.
Input
Boolean
true
Look
Standard, or Premium: a solid pill in your colour for the selected node and a soft shadow.
Input
Text
"Standard"
IndentSize
How far each level is indented, in pixels.
Input
Number
20
TreeLabel
What screen readers call the tree.
Input
Text
"Folders"
ExpandText
The start of an open button's name, read out and shown on hover, such as Expand Documents.
Input
Text
"Expand"
CollapseText
The start of a close button's name, such as Collapse Documents.
Input
Text
"Collapse"
LevelText
The word screen readers say before a node's level, such as Plans, level 2.
Input
Text
"level"
EmptyText
What the tree says when there are no nodes.
Input
Text
"Nothing here yet"
AccentColor
Your brand colour, for the selected node.
Input
Color
RGBA(15, 108, 189, 1)
Theme
Light, or Dark for a dark screen.
Input
Text
"Light"
Motion
Plays short animations: a node's highlight eases in when it's selected, and a chevron turns when its folder opens or closes. None plays for people who've asked their device for reduced motion.
Input
Boolean
true
Outputs
Property
Kind
Type
Default
SelectedKey
The Key of the selected node, or blank.
Output
Text
—
SelectedNode
The selected node's row from Nodes.
Output
Record
—
ExpandedKeys
Keys of the open nodes, separated by commas, to save and pass back as DefaultExpandedKeys.
Output
Text
—
VisibleCount
How many nodes show now.
Output
Number
—
Events
Property
Kind
Type
Default
OnNodeSelect(NodeKey)
Runs when the user selects a node. Open what it stands for here.
NodeKey (Text): The Key of the node.
Event
—
false
OnExpand(NodeKey)
Runs when the user opens a node. Load its children here if you load them as needed.
NodeKey (Text): The Key of the node.
Event
—
false
OnCollapse(NodeKey)
Runs when the user closes a node.
NodeKey (Text): The Key of the node.
Event
—
false
Actions
Property
Kind
Type
Default
Expand(NodeKey)
Opens a node, such as Expand(NodeKey) to show where something is.
NodeKey (Text): The Key of the node.
Action
—
—
Collapse(NodeKey)
Closes a node.
NodeKey (Text): The Key of the node.
Action
—
—
ExpandAll()
Opens every node that has children in Nodes. It doesn't run OnExpand.
Action
—
—
CollapseAll()
Closes every node.
Action
—
—
Guide
Use lcsTreeView for anything nested: document folders, product categories, teams and their people, a site's pages. Power Apps has no tree control, and the usual workaround nests galleries inside galleries, which is slow and stops at two levels. This component:
Draws the whole tree in one gallery, from one flat table: each node names its ParentKey.
Reads at a glance: a card with a title, thin guide lines that join each level to its parent, folders in amber and files in your colour, and how many items each folder holds.
Opens and closes nodes with a chevron.
Loads children only when needed: mark a node HasChildren: true without giving its children, and load them in OnExpand(NodeKey). The tree shows them as soon as they arrive.
Marks the selected node (a tint, a filled icon and bold text) and runs OnNodeSelect(NodeKey).
Remembers what's open as ExpandedKeys, so you can save it and open the same nodes next time.
Goes up to five levels deep, with your AccentColor, a Dark theme and two looks: Standard (a soft highlight for the selected node) and Premium (a solid pill in your colour and a soft shadow).
The examples call it treeDocs on your screen.
Give it your nodes as one table. ParentKey is blank for the top level:
// App.OnStart
Set(gblOpenFolders, Coalesce(LookUp(Settings, Name = "OpenFolders").Value, ""))
// treeDocs.DefaultExpandedKeys
gblOpenFolders
// Wherever you save: the nodes open now
Patch(Settings, LookUp(Settings, Name = "OpenFolders"), { Value: treeDocs.ExpandedKeys })
Show where something is, with the actions:
powerfx
// A button: open its folders, then select it
treeDocs.Expand("docs");
treeDocs.Expand("plans");
Set(gblCurrent, "q3")
// treeDocs.CurrentKey
gblCurrent
A folder tree in Dataverse is usually a table with a lookup to itself, such as Folders with a Parent Folder lookup to Folders. The row's unique identifier is the column named after the table (Folder), and a lookup gives its row's, so the keys are their text:
powerfx
// Screen1.OnVisible: the top level
ClearCollect(colFolders, Filter(Folders, 'Parent Folder' = Blank()))
// treeDocs.Nodes
ForAll(
colFolders,
{
Key: Text(Folder),
ParentKey: If(IsBlank('Parent Folder'), "", Text('Parent Folder'.Folder)),
Label: Name,
Icon: "Folder",
HasChildren: true
}
)
// treeDocs.OnExpand: a folder's children, the first time it opens
If(
IsEmpty(Filter(colFolders, Text('Parent Folder'.Folder) = NodeKey)),
Collect(colFolders, Filter(Folders, 'Parent Folder'.Folder = GUID(NodeKey)))
)
Loading each level as it opens keeps every query on the server, so a large tree isn't cut off at 500 rows.
Each node is a button named by its label and level ("Plans, level 2"). Its chevron is a separate button that says what it does ("Expand Plans", "Collapse Plans").
The selected node has a tint, a filled icon and bold text, so colour is never the only signal.
All the words screen readers hear are inputs (ExpandText, CollapseText, LevelText, TreeLabel), for your language.
With Motion on (the default), a node's highlight eases in from the left when it's selected and a chevron turns as its folder opens or closes, each in a third of a second or less. None plays for people who've asked their device for reduced motion, and Motion set to false changes them at once, as in 0.1.0.
Up to five levels. Deeper nodes don't show.
The arrow keys don't move through the tree. Canvas components can't read key presses, so Tab moves from button to button.
Nodes needs all five columns, with HasChildren true or false.
ExpandAll() opens nodes whose children are already in Nodes. It doesn't run OnExpand, so it won't load children that aren't loaded yet.
Up to 999 children under one node keep their order.
0.2.0: motion: the selected node's highlight eases in and a chevron turns when its folder opens or closes (skipped for reduced motion); a Motion input turns it off. With Motion off, it's exactly 0.1.0.
0.1.0: first version: one flat table, open and close, children loaded through OnExpand, selection, ExpandedKeys, and the Expand, Collapse, ExpandAll and CollapseAll actions.
Did it work for you?
No ratings yet.Nobody has said it worked in their app yet.
Sign in to rate it or to say it worked in your app.
Comments
LowCodeStacks teamPinned
Welcome! A tip: ExpandAll() opens only nodes whose children are already in Nodes. It doesn't run OnExpand, so it won't load children that aren't loaded yet.
What are you showing in it: folders, categories, an org chart? Tell us how deep your tree goes (it shows up to five levels) and ask anything here.