App <pm-app>
App shell: navigation, top bar, page and an optional detail pane, laid out for the screen it is on.
Overview
The menu button folds the sidebar here. On a tablet it opens the sidebar over the page, and on a phone the sidebar is a drawer, or a tab bar in native mode.
Overview
One markup gives a sidebar on desktops, an icon rail on tablets and a drawer on phones. With native mode on (mobile here or on an ancestor, or setMobile(true)), touch devices get app patterns instead: a bottom tab bar on phones and a labelled rail on tablets. Desktops look the same in both modes.
Light DOM: the shell never moves or wraps your elements, so it is safe in every framework. Regions are plain children, found by class: aside.pm-app-side (brand, pm-nav, .pm-app-side-footer), .pm-app-main (holding pm-app-bar and main.pm-app-content) and an optional aside.pm-app-detail.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
layout | 'sidebar' | 'rail' | 'top' | — | Navigation on desktops: a sidebar (default), a labelled rail, or a row above the page. |
collapsible | boolean | — | Let people fold the sidebar to icons (toggleNav(), or the bar's menu button). |
collapsed | boolean | — | The sidebar is folded to icons. |
persist | string | — | Remember collapsed under this name (local storage). |
mobile | boolean | — | Native app patterns on touch devices (inherits from ancestors; mobile="false" opts out). |
mobile-navprop: mobileNav | 'bar' | 'drawer' | 'none' | — | Navigation on native phones: tab bar (default), drawer, or none. |
tablet-navprop: tabletNav | 'rail' | 'sidebar' | 'drawer' | — | Navigation on tablets: rail (default; icons only on the web, icon over label in native mode), the full sidebar, or a drawer. |
max-tabsprop: maxTabs | number | — | Most tabs in the phone tab bar (default 5); further items go under "More". |
detail-openprop: detailOpen | boolean | — | Show the detail pane (showDetail() / hideDetail()). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-layout-change | onPmLayoutChange | The size class, mode or navigation changed. |
pm-collapse | onPmCollapse | The sidebar was folded or unfolded. |
pm-nav-toggle | onPmNavToggle | The drawer opened or closed. |
pm-detail-toggle | onPmDetailToggle | The detail pane opened or closed. |
Slots
| Slot | Description |
|---|---|
(default) | aside.pm-app-side, .pm-app-main and optionally aside.pm-app-detail. |
Methods
toggleNav(), showDetail(), hideDetail()
Used in templates
Overview dashboardTraffic analyticsOrdersCustomer 360InboxTeam chatAI assistantNotificationsProject boardTeam and rolesBilling and invoicesUser profileAccount settings