Top app bar
A header with the screen title and actions, in three sizes, with scroll behaviour.
import { TopAppBar } from '@windmorph/react';Keyboard
| Key | Action |
|---|---|
| Tab | Moves focus through the navigation icon, the actions and the bottom row, in that order. |
| Enter or Space | Activates the focused control. |
The bar adds no keys of its own; each control keeps its own keys.
Screen reader
- Role
- A
headerelement, which is abannerlandmark when it is not insidearticle,aside,main,navorsection. - Accessible name
- The bar itself has no name, and it doesn't name the page: wrap
titlein a heading when it is the page's name. - States announced
- None of its own; its controls announce their own states.
- A medium or large bar renders the title twice, but only one is announced at a time: the expanded title until the bar is half collapsed, then the top-row one (the other is
aria-hidden), so the title is never read twice. - A bar scrolled fully off screen is
inert, so it leaves the accessibility tree until it comes back.
Focus
- Its controls are in the Tab order where the bar sits in the page, so the navigation icon is the first stop, as M3 asks.
- Each control shows its own focus ring on keyboard focus.
- A bar scrolled fully off screen (
enter-always, or a small bar'sexit-until-collapsed) isinert: Tab skips its controls and screen readers leave them out until it comes back. - While keyboard focus is on one of its controls the bar stays on screen as the page scrolls, and focusing a partly hidden bar brings it back, so a focused control is never hidden (WCAG 2.4.11).
Touch target
The bar adds no targets of its own. Its icon buttons are standard IconButtons, which keep their 48 × 48px touch target.
Motion
The bar collapses with the page's scroll, following the scroll position rather than animating. Under reduced motion an enter-always bar stays on screen: a small bar stays put and a medium or large one only collapses to its top row, as with exit-until-collapsed. The colour change when content scrolls under it fades on the effects spring.
What you need to do
- Wrap
titlein a heading (<h1>) when it names the page, and keep it the same as the page's name. - Give every icon-only control in
navigationIconandactionsanaria-labelthat says what it does ("View on map"). - With
scrolledColor="transparent", give the icon buttons a container fill (variant="tonal") so they stay legible over the content.