Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Navigation

AppBar <pm-app-bar>

App bar: the sticky bar above a page, with the menu button, a back button, the page title, search and actions.

Full screen
Paid Lumen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/app-bar'; import '@prismora/elements/avatar'; import '@prismora/elements/badge'; import '@prismora/elements/button'; import '@prismora/elements/icon'; import '@prismora/elements/input'; import { registerIcons } from '@prismora/elements/icon'; import { moreHorizontal, search, share, zap } from '@prismora/icons'; registerIcons([moreHorizontal, search, share, zap]); </script> <pm-app-bar heading="Order 1042" back="#orders" show-back="always" data-static style="inline-size: min(100%, 36rem); border: 1px solid var(--pm-sf-border); box-shadow: var(--pm-sf-shadow); border-radius: var(--pm-radius-lg); overflow: clip"> <pm-badge tone="success" variant="soft">Paid</pm-badge> <pm-button slot="end" variant="ghost" tone="neutral" icon icon-start="share" label="Share"></pm-button> <pm-button slot="end" variant="ghost" tone="neutral" icon icon-start="more-horizontal" label="More actions"></pm-button> </pm-app-bar> <pm-app-bar data-static style="inline-size: min(100%, 36rem); border: 1px solid var(--pm-sf-border); box-shadow: var(--pm-sf-shadow); border-radius: var(--pm-radius-lg); overflow: clip"> <span slot="start" class="pm-brand"> <pm-icon name="zap"></pm-icon> <span class="pm-brand-name">Lumen</span> </span> <pm-input slot="search" type="search" label="Search orders" hide-label placeholder="Search orders" icon-start="search"></pm-input> <pm-avatar slot="end" name="Ada Lovelace" size="sm"></pm-avatar> </pm-app-bar>

Overview

In native mode on phones and tablets it behaves like an app's navigation bar: the page's own <h1> is the large title, and its text fades into the bar once the heading has scrolled away; back shows a back button; the search field moves to its own row. On the web and on desktops it is a plain toolbar row.

Works inside <pm-app> (its menu button then opens the drawer or folds the sidebar) and on its own.

Attributes

AttributeTypeDefaultDescription
headingstring—Title text. Default: the text of the page's <h1>.
backstring—Show a back button. With a URL it is a link; empty, it goes back in history.
show-back
prop: showBack
'native' | 'always'—When the back button shows: on touch layouts in native mode (native, default) or always.
nav-toggle
prop: navToggle
booleanfalseShow the menu button where the shell has something to open or fold.
title-mode
prop: titleMode
'auto' | 'inline' | 'large' | 'none'—auto (default): in native mode on touch layouts the title appears when the page heading scrolls away; elsewhere the bar has no title unless heading is set. inline: always shown. large: always the collapsing behaviour. none: never.
menu-label
prop: menuLabel
string—Accessible name of the menu button (default "Menu").
back-label
prop: backLabel
string—Accessible name of the back button (default "Back").
mobileboolean—Native app patterns on touch devices (inherits from ancestors; mobile="false" opts out).

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-backonPmBackThe back button was used. Cancel it to handle navigation yourself.
pm-nav-toggleonPmNavToggleThe menu button was used outside a pm-app (inside one, the shell fires it).

Slots

SlotDescription
startAfter the menu and back buttons (a workspace switcher, a logo).
(default)Next to the title (tabs, a status).
searchA search field.
endActions at the end (notifications, account menu).

CSS parts

PartDescription
::part(base)The bar.
::part(title)The title in the bar.
::part(nav-toggle)The menu button.
::part(back)The back button.

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360InboxTeam chatAI assistantNotificationsProject boardTeam and rolesBilling and invoicesUser profileAccount settings