Tab Bar
モバイル風の下部ナビゲーション:アイコンとアクティブなタブのラベルを持つリンクまたはボタンを、ホームインジケーターを避けるフローティングのピルまたは全幅のバーで表示します。
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
Active tab: home
<div class="demo-stack" style="max-width: 24rem">
<sone-tab-bar ariaLabel="Demo app" [items]="items" [(value)]="tab" />
<sone-tab-bar
ariaLabel="Demo app, full width"
[items]="items"
[(value)]="tab"
[floating]="false"
labels="always"
/>
<p class="text-hint">Active tab: {{ tab() }}</p>
</div>インポート
import {
SoneTabBarComponent,
} from "@surface-one/angular/tab-bar";API リファレンス
SoneTabBarComponentコンポーネント
`<sone-tab-bar>` — mobile-style bottom navigation for the web (the twin of the React Native `SoneTabBar`): a `nav` of `items`, each a link (`href`, `aria-current="page"` while active) or a button (`aria-current="true"`), with an icon and the active tab's label (`labels="always"` shows every label; a hidden one still names the tab). The active tab is `[(value)]`. `floating` (the default) is a centred pill that sticks to the bottom of the scrolling page; without it a full-width bar with a top hairline. Both clear the home indicator (`env(safe-area-inset-bottom)`).
| 名前 | 型 | デフォルト |
|---|---|---|
items必須 | readonly TabBarItem[] | — |
value双方向The active tab's value — `[(value)]`. | string | null | null |
ariaLabelNames the navigation landmark. | — | $localize`:A bottom tab bar's navigation:Tab bar` |
labels`active` shows the active tab's label only; `always` every label. | TabBarLabels | "active" |
floatingA centred pill (the default); `false` is a full-width bar. | boolean | true |