A horizontal nav bar with mega-menu dropdown panels. Supports single and two-column layouts, section headers, SVG icons, three active states, and full light/dark theming.
Power Apps Studio rendering note
After importing, the component may appear incomplete in the Studio editor until you press F5 (Preview) or publish. This is standard Power Apps behavior for YAML-imported components — the editor doesn't fully evaluate nested gallery templates until a preview cycle. End users always see the fully rendered component.
Click menu items to interact
This component requires Modern controls to be enabled. Settings → Updates → Preview → Modern controls and themes
# In Power Apps Studio:
1. Components tab → New component → Import from code
2. Paste the full YAML definition
3. Add the component to any screen
4. Press F5 (Preview) to see the fully rendered component// MenuItems — the top navigation bar buttons
// Each item needs: ID, Label, HasDropdown, Link
cmpNavigationMenu.MenuItems = Table(
{ ID: "dashboard", Label: "Dashboard", HasDropdown: false, Link: "DashboardScreen" },
{ ID: "inventory", Label: "Inventory", HasDropdown: true, Link: "" },
{ ID: "operations", Label: "Operations", HasDropdown: true, Link: "" },
{ ID: "reports", Label: "Reports", HasDropdown: true, Link: "" }
)// DropdownItems — content for each dropdown panel
// MenuID links items to their parent menu button
// Column: 1 = left, 2 = right (for 2-column layouts)
// Section: optional header text above each column group
cmpNavigationMenu.DropdownItems = Table(
{ MenuID: "inventory", Section: "Products", Icon: "Layout",
Label: "All Items", Description: "Browse full catalog",
Link: "ItemsScreen", Column: 1 },
{ MenuID: "inventory", Section: "Products", Icon: "BarChart",
Label: "Stock Levels", Description: "Current quantities",
Link: "StockScreen", Column: 1 },
{ MenuID: "inventory", Section: "Tracking", Icon: "Rocket",
Label: "Incoming", Description: "Expected shipments",
Link: "IncomingScreen", Column: 2 },
{ MenuID: "inventory", Section: "Tracking", Icon: "Zap",
Label: "Adjustments", Description: "Manual corrections",
Link: "AdjustScreen", Column: 2 }
)// OnItemSelect — fires when any item is clicked
// Use SelectedItem output to route navigation
cmpNavigationMenu.OnItemSelect = Switch(
cmpNavigationMenu.SelectedItem.Link,
"DashboardScreen", Navigate(scrDashboard),
"ItemsScreen", Navigate(scrItems),
"StockScreen", Navigate(scrStock),
"IncomingScreen", Navigate(scrIncoming)
)
// Or use a lookup table approach
cmpNavigationMenu.OnItemSelect = Navigate(
LookUp(
colScreenMap,
Link = cmpNavigationMenu.SelectedItem.Link
).Screen
)| Property | Type | Default |
|---|---|---|
MenuItemsTop-level nav buttons (ID, Label, HasDropdown, Link) | Table | See default |
DropdownItemsDropdown content (MenuID, Section, Icon, Label, Description, Link, Column) | Table | See default |
DropdownColumnsColumns in dropdown panel (1 = list, 2 = mega menu) | Number | 2 |
NavAlignMenu bar alignment: "Left", "Center", or "Right" | Text | "Center" |
ActiveColorAccent color for active/selected states | Color | RGBA(37,99,235,1) |
Theme"Light" or "Dark" theme | Text | "Light" |
ShowIconsShow icons in dropdown items | Boolean | true |
ShowDescriptionsShow description text in dropdown items | Boolean | true |
ShowNavScrollbarShow scrollbar on the nav bar gallery | Boolean | false |
ShowDropdownScrollbarShow scrollbar in dropdown galleries | Boolean | false |
| Property | Type | Description |
|---|---|---|
SelectedItem | Record | The last clicked item record (from MenuItems or DropdownItems) |
SelectedMenuID | Text | ID of the currently open or last selected parent menu |
IsOpen | Boolean | Whether a dropdown panel is currently open |
| Event | Description |
|---|---|
OnItemSelect | Fires when any menu button or dropdown item is clicked. Use with SelectedItem to route navigation. |
MenuItems defines the top bar buttons. DropdownItems holds all dropdown content, linked via MenuID. This separation lets you modify dropdown content independently and keeps formulas clean.
Menu buttons highlight in three scenarios: when their dropdown is open, when clicked as a direct link (e.g. Dashboard), or when a child dropdown item was last selected and the dropdown is closed. All three use the ActiveColor property.
When DropdownColumns is 2, the panel checks if Column 2 items exist for the active menu. If not, it renders a narrow single-column panel. On screens under 500px, all items collapse into a single scrollable column regardless of the setting.
A transparent backdrop sits behind the dropdown panel and catches clicks anywhere inside the component below the nav bar. It is deliberately offset below the bar so it never intercepts clicks on the menu buttons themselves.
Screens have no OnSelect property, so dismissing from anywhere else on the screen needs a transparent button instead. Add this as the first control on your screen, above everything else in the tree, so it renders at the bottom of the z-order and never competes with your other controls.
- btnScreenDismiss:
Control: Classic/Button@2.2.0
Properties:
BorderStyle: =BorderStyle.None
Color: =RGBA(0, 0, 0, 0)
Fill: =RGBA(0, 0, 0, 0)
FocusedBorderThickness: =0
Height: =Parent.Height
HoverFill: =RGBA(0, 0, 0, 0)
OnSelect: =Set(_navOpenMenu, Blank())
PressedFill: =RGBA(0, 0, 0, 0)
Text: =""
Visible: =!IsBlank(_navOpenMenu)
Width: =Parent.Width
X: =0
Y: =0The Visible condition keeps the button out of the way entirely when no dropdown is open.
The Icon field supports 9 built-in names: Layout, FileText, BarChart, Settings, Code, Book, Rocket, Zap, Sparkles. You can also pass raw SVG strings or data:image/svg+xml URIs for custom icons.
On desktop (500px+), buttons size between 120–160px with 14px font. On mobile (<500px), buttons lock at 120px min with 12px font and the nav bar becomes horizontally swipeable. Two-column dropdowns collapse to a single column, and section headers hide to avoid confusion.
The nav bar is 48px tall, or 68px when ShowNavScrollbar is true. The dropdown backdrop offsets by the same amount so it starts flush underneath the bar. If you customize the bar height, update the backdrop Height and Y to match, or clicks on the nav bar will be intercepted while a dropdown is open.
// Reports — no sections, single column
// Section: "" means no header shown
DropdownItems: Table(
{ MenuID: "reports", Section: "",
Icon: "BarChart",
Label: "Inventory Value",
Description: "Cost summaries",
Link: "ValueReportScreen",
Column: 1 },
{ MenuID: "reports", Section: "",
Icon: "Sparkles",
Label: "Turnover Analysis",
Description: "Sell-through rates",
Link: "TurnoverScreen",
Column: 1 },
{ MenuID: "reports", Section: "",
Icon: "Book",
Label: "Low Stock Alerts",
Description: "Items below threshold",
Link: "LowStockScreen",
Column: 1 }
)// Inventory — 2 columns with sections
// Column 1 = "Products"
// Column 2 = "Tracking"
DropdownItems: Table(
{ MenuID: "inventory",
Section: "Products",
Icon: "Layout",
Label: "All Items",
Description: "Browse catalog",
Link: "ItemsScreen",
Column: 1 },
{ MenuID: "inventory",
Section: "Tracking",
Icon: "Rocket",
Label: "Incoming",
Description: "Expected shipments",
Link: "IncomingScreen",
Column: 2 }
// ... more items
)
cmpNavigationMenu.DropdownColumns = 2| Field | Type | Notes |
|---|---|---|
| ID | Text | Unique identifier, matches MenuID in DropdownItems |
| Label | Text | Button text displayed in the nav bar |
| HasDropdown | Boolean | true = has dropdown panel, false = direct link |
| Link | Text | Screen name or route for direct-link items |
| Field | Type | Notes |
|---|---|---|
| MenuID | Text | Links to parent MenuItem ID |
| Section | Text | Column header text (blank = no header) |
| Icon | Text | Built-in name, raw SVG string, or data URI |
| Label | Text | Item title |
| Description | Text | Subtitle (hidden when ShowDescriptions = false) |
| Link | Text | Screen name or route identifier |
| Column | Number | 1 = left column, 2 = right column |
19 controls across 3 group containers, 3 galleries, and supporting labels/buttons.
14 properties — 10 input, 3 output, 1 event.
cmpNavigationMenu
├── cntNavRoot (GroupContainer — full width)
│ └── cntNavBar (GroupContainer — 48px bar, border-bottom)
│ └── galMenuItems (Horizontal Gallery)
│ ├── btnMenuItem (button per item)
│ └── imgChevron (▾ indicator)
├── btnBackdrop (transparent full-screen click catcher)
└── cntDropdownPanel (GroupContainer — positioned below active item)
├── lblCol1Section (section header above col 1)
├── lblCol2Section (section header above col 2)
├── galDDCol1 (Gallery — column 1 items)
│ ├── imgIcon + lblLabel + lblDesc + btnHit
└── galDDCol2 (Gallery — column 2 items)
└── imgIcon + lblLabel + lblDesc + btnHitOne email when something new ships. Unsubscribe anytime.
Use the toolbar to format · or type markdown directly