NewPower Apps · canvas componentNavigation and layout✓ Tested in StudioMIT License
Navigation shell
Your app's main menu: a side menu on wide screens that collapses to icons, and a bottom bar on phones, from one table. Badges, items hidden or disabled by role, the current screen marked, who is signed in, an animated light and dark switch, and outputs that place your content beside it.
As it is when you paste it, with every input at its default.
Screen1
Home
Updated just now
Open orders24Customers132This week$8.4k
Orders this week
Recent
JMJordan MilesShipped
SKSam KerrPacking
RLRiya LalNew
ATAna TorresShipped
KOKofi OwusuNew
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.
The Key of the screen the user is on, from your app, so the menu marks it. Leave it blank and the menu marks the item last selected.
Input
Text
""
HiddenKeys
Keys of items to hide, separated by commas, such as for a role.
Input
Text
""
DisabledKeys
Keys of items to show but not allow, separated by commas.
Input
Text
""
StartCollapsed
Starts the side menu collapsed to its icons.
Input
Boolean
false
ScreenWidth
The width of your screen. Set it to Parent.Width, so the menu becomes a bottom bar on phones.
Input
Number
1366
ScreenHeight
The height of your screen. Set it to Parent.Height.
Input
Number
768
BottomBarBelow
Below this screen width, the menu is a bottom bar.
Input
Number
640
MaxBottomItems
How many items the bottom bar shows, from the top of the list.
Input
Number
5
ExpandedWidth
The width of the side menu when it isn't collapsed.
Input
Number
240
ShowToggle
Shows the button that collapses and expands the side menu.
Input
Boolean
true
MenuLabel
What screen readers call the menu.
Input
Text
"Main menu"
CollapseText
The collapse button's name, read out and shown on hover.
Input
Text
"Collapse the menu"
ExpandText
The expand button's name, read out and shown on hover.
Input
Text
"Expand the menu"
ShowUser
Shows who is signed in at the bottom of the side menu.
Input
Boolean
true
UserName
The signed-in person's name, such as User().FullName. The avatar shows their initials when there's no picture.
Input
Text
"Avery Brooks"
UserDetail
A line under the name, such as their role or User().Email.
Input
Text
"Admin"
UserImage
The person's picture, such as User().Image. Leave it blank for initials.
Input
Image
""
ShowThemeToggle
Shows the sun and moon button that switches between light and dark.
Input
Boolean
true
DarkText
The theme button's name in light mode, read out and shown on hover.
Input
Text
"Switch to dark theme"
LightText
The theme button's name in dark mode.
Input
Text
"Switch to light theme"
AccentColor
Your brand colour, for the current item and badges.
Input
Color
RGBA(15, 108, 189, 1)
Look
Standard, or Premium: a floating card with a soft shadow, your app's mark, a solid pill for the current item and the user in a card.
Input
Text
"Standard"
Theme
Light, or Dark for a dark app. The theme button changes it inside the menu; keep your app in step with OnThemeChange.
Input
Text
"Light"
Motion
Plays short animations: the current item's highlight eases in when it changes, and a new badge pulses twice. They never play for people who've asked their device for reduced motion.
Input
Boolean
true
Outputs
Property
Kind
Type
Default
IsCollapsed
True while the side menu is collapsed to its icons.
Output
Boolean
—
IsBottomBar
True while the menu is a bottom bar, on a narrow screen.
Output
Boolean
—
SelectedKey
The Key of the item the menu marks as current.
Output
Text
—
CurrentTheme
Light or Dark: the Theme input, or what the theme button chose.
Output
Text
—
ShellX
Set the component's X to this.
Output
Number
—
ShellY
Set the component's Y to this.
Output
Number
—
ShellWidth
Set the component's Width to this.
Output
Number
—
ShellHeight
Set the component's Height to this.
Output
Number
—
ContentX
Where your screen's content starts, from the left.
Output
Number
—
ContentY
Where your screen's content starts, from the top.
Output
Number
—
ContentWidth
How wide your screen's content can be.
Output
Number
—
ContentHeight
How tall your screen's content can be.
Output
Number
—
Events
Property
Kind
Type
Default
OnNavigate(ItemKey)
Runs when the user selects an item. Go to its screen here with Navigate, using ItemKey to choose the screen.
ItemKey (Text): The Key of the item selected.
Event
—
false
OnToggle(Collapsed)
Runs when the user collapses or expands the side menu.
Collapsed (Boolean): True when the menu is now collapsed.
Event
—
false
OnThemeChange(NewTheme)
Runs when the user switches between light and dark. Set your app's theme here.
NewTheme (Text): Light or Dark: the theme now chosen.
Event
—
false
OnUserSelect()
Runs when the user selects their avatar. Open their profile or a sign-out choice here.
Event
—
false
Actions
Property
Kind
Type
Default
SetCollapsed(Collapsed)
Collapses or expands the side menu, such as SetCollapsed(true) on a small tablet.
Collapsed (Boolean): True to collapse it, false to expand it.
Action
—
—
Guide
Use lcsNavShell as the main menu of an app with several screens. Building one by hand means a gallery per screen size, a variable for the collapse state and the same formulas copied onto every screen. This component gives you:
One table for the menu. Each item has a Key (your own id), a Label, an Icon (a Fluent icon name, such as Home) and a Badge (text such as 3, or blank).
A side menu on wide screens with your app's name and a button that collapses it to icons. Collapsed, each icon shows its name on hover, and its badge as a dot with the count.
A bottom bar on phones, with an icon and a short label per item. It switches by itself below the width you choose (BottomBarBelow, 640 by default).
The current screen, from your app. Set CurrentKey and the menu marks that item, with a bar and a filled icon.
Items for some people only: hide items by key (HiddenKeys), or show them but don't allow them (DisabledKeys).
Who is signed in, at the bottom of the side menu: their picture (or initials), name and a line such as their role. Selecting it runs OnUserSelect().
Motion that feels finished: the current item's highlight eases in and its bar grows when the screen changes, and a new badge pulses twice to catch the eye. Turn it off with Motion; it never plays for people who've asked their device for reduced motion.
A light and dark switch beside it: a sun that turns into a moon, animated (it doesn't move for people who've asked for reduced motion). It switches the menu and runs OnThemeChange(NewTheme), so your app can follow.
Outputs that place it and your content, so the content moves over when the menu collapses or becomes a bottom bar.
Two looks:Standard, a plain side panel, and Premium, a floating card with a soft shadow, your app's mark (its first letter on your colour), a solid pill for the current item and the person signed in on their own card.
Your AccentColor, and a Dark theme. Hover and press shades follow the menu's own theme, so they show in dark mode too.
The examples call it navMain. Put it on each screen (or copy it), and give it the screen's size:
The menu holds no data, but a badge often counts rows. On a whole Dataverse table, CountRows returns a number Dataverse caches, which can be out of date. For an exact count of up to 50,000 rows, use CountIf, and compare a choice column with its own values:
Each item is one button, named by its label and badge ("Orders, 3"). The current item is marked by a bar, a filled icon and bold text, so colour is never the only signal.
Disabled items stay in the menu, dimmed, but can't be selected, and screen readers say they're unavailable.
Every button shows a focus ring in your colour when reached with the keyboard.
The collapse button says what it does ("Collapse the menu", "Expand the menu"), and so does the theme button ("Switch to dark theme"). All of these phrases are inputs, for your language.
The avatar is a button named by the person's name and detail.
The animations are short and play once: the sun and moon half a second, the current item's highlight about a third of a second, a new badge's pulse two rounds of about a second. None of them loops, and none plays for people who've asked their device for reduced motion. Motion turns them all off except the theme switch.
Collapsed, each icon shows its label on hover. Choose clear icons.
Badges are white on your AccentColor. Pick an accent dark enough for white text (the default meets WCAG AA).
The menu is one level. Group related screens under one item and use Tabs on that screen.
The bottom bar shows the first MaxBottomItems items (5 by default). Put the ones people use most first.
Icons are names from Power Apps' own set of about 180 (the same set as the classic icons), as the modern button and Icon controls use them: Home, People, Settings, Cart, Document, Folder, Mail, Calendar and so on. A name outside the set shows no icon, so pick from the Icon list in Studio.
A canvas component can't place itself, so set its X, Y, Width and Height from the outputs, as shown above. If you leave its Width at 240, the collapsed menu still draws 64 pixels wide, but the rest of its box stays over your screen.
The theme button changes the menu's own theme at once. To change it from your app as well, set Theme from your own variable and set that variable in OnThemeChange.
The bottom bar has no room for the avatar or the theme button; put them on a settings screen on phones.
On each screen it's a separate copy. Keep the menu the same everywhere with a global table (gblMenu) in App.Formulas, and set Items to it.
0.2.0: motion: the current item's highlight eases in and its bar grows when it changes, and a new badge pulses twice; a Motion input turns them off. With Motion off, it looks and works exactly as 0.1.0.
0.1.0: first version: side menu that collapses to icons, bottom bar on phones, badges, HiddenKeys and DisabledKeys, CurrentKey, placement outputs, OnNavigate and OnToggle, SetCollapsed(); who is signed in (OnUserSelect) and an animated light and dark switch (OnThemeChange, CurrentTheme).
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! Our favourite tip: each screen has its own copy of the menu, so keep it the same everywhere with one global table (gblMenu) in App.Formulas, and set Items to it.
How many screens does your app have, and does the bottom bar on phones fit them? Ask here about roles, badges or themes.