App Bar
The top bar of a screen: a back button or link, the title as a real heading with a subtitle, and trailing actions, in a header that can stick to the top and clears the notch.
Angular: available Vue: available React: available React Native: available
Usage
Back pressed 0 times
<div class="demo-stack" style="max-width: 24rem">
<sone-app-bar
title="Inbox"
subtitle="12 unread"
[level]="3"
showBack
(back)="backs.set(backs() + 1)"
>
<button soneAppBarTrailing soneBtn type="button" variant="ghost" size="icon" aria-label="Search">
<sone-icon icon="search" />
</button>
</sone-app-bar>
<p class="text-hint" aria-live="polite">Back pressed {{ backs() }} times</p>
</div>Import
import {
SoneAppBarComponent,
SoneAppBarTrailingDirective,
} from "@surface-one/angular/app-bar";API reference
SoneAppBarComponentComponent
`<sone-app-bar>` — the top bar of a screen (the web twin of the React Native `SoneAppBar`): an optional back button, the title as a real heading (`level`, default 1) with a subtitle under it, and `[soneAppBarTrailing]` actions at the end. It renders a `<header>`, so it is the page's banner when it sits outside `main`. `sticky` pins it to the top of the scrolling page; its top padding clears the notch (`env(safe-area-inset-top)`). `showBack` draws a back button that emits `(back)`; `backHref` makes it a link.
| Name | Type | Default |
|---|---|---|
titlerequired | string | — |
subtitleA line under the title. | string | null | null |
levelThe title's heading level, 1–6. | HeadingLevel | 1 |
showBackShows the back button, which emits `(back)`. | boolean | false |
backHrefMakes the back button a link to this URL (it shows without `showBack`). | string | null | null |
backLabelThe back button's accessible name. | — | $localize`:Goes back to the previous screen:Back` |
stickyPins the bar to the top of the scrolling page. | boolean | false |
| Name | Type |
|---|---|
backThe back button was pressed (not emitted for a `backHref` link). | void |
SoneAppBarTrailingDirectiveDirective
`[soneAppBarTrailing]` — what sits at the end of the bar: icon buttons, an avatar …