App Bar
画面上部のバー:戻るボタンまたはリンク、サブタイトル付きの本物の見出しとしてのタイトル、末尾のアクションを、上部に固定でき、ノッチを避ける header にまとめます。
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
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 {
SoneAppBarComponent,
SoneAppBarTrailingDirective,
} from "@surface-one/angular/app-bar";API リファレンス
SoneAppBarComponentコンポーネント
`<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.
| 名前 | 型 | デフォルト |
|---|---|---|
title必須 | 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 |
| 名前 | 型 |
|---|---|
backThe back button was pressed (not emitted for a `backHref` link). | void |
SoneAppBarTrailingDirectiveディレクティブ
`[soneAppBarTrailing]` — what sits at the end of the bar: icon buttons, an avatar …