Lemon pasta
Sourdough
Pad thai
Summer salad
Tomato soup
Apple pie
Fried rice
Banana bread
An app bar sits at the top of a screen and shows its title, navigation and actions, and can hide or compress as the page scrolls.
<md-gb-app-bar>
<md-gb-icon-button slot="leading" aria-label="Open menu">
<md-gb-icon>menu</md-gb-icon>
</md-gb-icon-button>
Inbox
<span slot="subtitle">24 unread</span>
<md-gb-icon-button slot="trailing" aria-label="Search">
<md-gb-icon>search</md-gb-icon>
</md-gb-icon-button>
</md-gb-app-bar>Install with shadcn/ui: npx shadcn@latest add https://material-web.dev/3.0/r/md-app-bar.json (setup)
This component is new in M3 Expressive.
An app bar holds a leading navigation button, a title with an optional subtitle or image, and trailing actions.
<md-gb-app-bar>
<md-gb-icon-button slot="leading" aria-label="Back">
<md-gb-icon>arrow_back</md-gb-icon>
</md-gb-icon-button>
Trip to Lisbon
<span slot="subtitle">3 days</span>
<md-gb-icon-button slot="trailing" aria-label="Share">
<md-gb-icon>share</md-gb-icon>
</md-gb-icon-button>
<md-gb-icon-button slot="trailing" aria-label="Favorite">
<md-gb-icon>favorite</md-gb-icon>
</md-gb-icon-button>
</md-gb-app-bar>Set size to md or lg for a taller bar. The default is sm.
<md-gb-app-bar size="md">
<md-gb-icon-button slot="leading" aria-label="Back">
<md-gb-icon>arrow_back</md-gb-icon>
</md-gb-icon-button>
Settings
</md-gb-app-bar>Add centered to center the title and subtitle.
<md-gb-app-bar centered>
<md-gb-icon-button slot="leading" aria-label="Open menu">
<md-gb-icon>menu</md-gb-icon>
</md-gb-icon-button>
Photos
</md-gb-app-bar>Set variant="search" and put a text input in the search slot.
<md-gb-app-bar variant="search">
<md-gb-icon-button slot="leading" aria-label="Back">
<md-gb-icon>arrow_back</md-gb-icon>
</md-gb-icon-button>
<input slot="search" type="search" aria-label="Search mail">
</md-gb-app-bar>Set scroll-behavior to hide to hide the bar while scrolling down, or to compress to turn a medium or large bar into a small one. Use scroll-target with the id of a scrolling element, or leave it out to follow the window.
Lemon pasta
Sourdough
Pad thai
Summer salad
Tomato soup
Apple pie
Fried rice
Banana bread
<div id="content">
<md-gb-app-bar size="lg" scroll-behavior="compress" scroll-target="content">
<md-gb-icon-button slot="leading" aria-label="Back">
<md-gb-icon>arrow_back</md-gb-icon>
</md-gb-icon-button>
Recipes
</md-gb-app-bar>
<p>Lemon pasta</p>
<p>Sourdough</p>
<p>Pad thai</p>
<p>Summer salad</p>
<p>Tomato soup</p>
<p>Apple pie</p>
<p>Fried rice</p>
<p>Banana bread</p>
</div>#content {
inline-size: 100%;
block-size: 280px;
overflow: auto;
}
md-gb-app-bar {
position: sticky;
inset-block-start: 0;
}On small windows only a few trailing actions show. The rest are listed in the overflowchange event, and the overflow slot holds a menu button that appears while actions are collapsed.
<md-gb-app-bar>
Gallery
<md-gb-icon-button slot="trailing" aria-label="Search">
<md-gb-icon>search</md-gb-icon>
</md-gb-icon-button>
<md-gb-icon-button slot="trailing" aria-label="Share">
<md-gb-icon>share</md-gb-icon>
</md-gb-icon-button>
<md-gb-icon-button slot="trailing" aria-label="Favorite">
<md-gb-icon>favorite</md-gb-icon>
</md-gb-icon-button>
<md-gb-icon-button slot="overflow" aria-label="More options">
<md-gb-icon>more_vert</md-gb-icon>
</md-gb-icon-button>
</md-gb-app-bar>aria-label if the title alone is unclear.aria-label.setupScrollPadding() from scroll-padding.js so focused elements scroll clear of it.104 of 319 buildable spec units are tested, 22 are excluded with a written reason and 0 are uncovered (the target is 0). 47 of 51 token declarations match the spec (92%), and 4 have no spec token.
app-bars on m3.material.io (opens in a new tab) How compliance is measured
The component’s own CSS and JavaScript rely only on web platform features that are Baseline widely available: it works in Chrome 124, Edge 124, Firefox 125, Safari 17.4 and later.
Newer features it uses where the browser has them (progressive enhancements):
Browser support Learn more about Baseline (opens in a new tab)
The component renders no interactive role of its own.
2 rendered states run through axe-core and the WAI-ARIA 1.3 role and attribute rules in a real browser, with no known gaps.
WAI-ARIA 1.3 (opens in a new tab) ARIA Authoring Practices (opens in a new tab) Accessibility
Audits under 90:
Lighthouse 12.8.2 (desktop, 2026-11-08) on the component alone: its first example on a page of its own, without this site's shell. The modules are the development build (not bundled or minified), so the performance score is indicative.
A Material Design app bar component.
| Property | Attribute | Type | Default |
|---|---|---|---|
centeredWhether the title and subtitle are centered instead of leading-aligned (the M3 Expressive "centered text" configuration). Defaults to false. |
centered |
boolean |
false |
scrollBehaviorHow the app bar reacts to scrolling: hide (hide on scroll down, reveal on scroll up) or compress (medium and large flexible app bars become small until scrolled back to the top). |
scroll-behavior |
"hide" |
"compress" |
scrolledWhether the app bar is in its scrolled state. Defaults to false. A medium or large flexible app bar in its scrolled state is shown as a small one (app-bars.md: "When scrolled, medium flexible and large flexible app bars can transform into small app bars"). |
scrolled |
boolean |
false |
scrollTargetThe id of the element whose scrolling drives scroll-behavior. Defaults to the window. |
scroll-target |
string |
'' |
sizeThe size of the app bar ( sm, md, lg). Defaults to sm. |
size |
AppBarSize |
'sm' |
variantThe behavioral variant of the app bar ( standard or search). Defaults to standard. |
variant |
AppBarVariant |
'standard' |
Changes apply to this site and its demos, and are remembered in this browser.
Your browser did not offer to install the docs as an app. Install them from the browser instead: