メニュー

上の帯

中身の上に貼り付く帯です。画面の見出しと、検索や操作を置きます。

見本で種類と状態を確かめる

高さ 56 で、スクロールしても上に残ります。767 以下は中央に画面名・左に戻る・右に操作 1〜2、768 以上は左に画面の見出し(title-2)・右に検索と操作です。768 以上の下の線は、スクロールしたときだけ出ます。

戻るあり

11月の明細

操作だけ

見通し

コードを写す

HTML

<header class="mz-topbar">
  <div class="mz-topbar__lead"><button class="mz-icon-button" type="button" aria-label="明細の一覧に戻る"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button></div>
  <h1 class="mz-topbar__title">11月の明細</h1>
  <div class="mz-topbar__actions">
    <div class="mz-search" role="search" aria-label="明細"><svg class="mz-search__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg><input class="mz-search__input" type="search" aria-label="明細を探す"><kbd class="mz-kbd mz-search__kbd" aria-hidden="true">/</kbd></div>
    <button class="mz-button" data-size="sm" type="button">明細を取り込む</button>
  </div>
</header>

スマホ(767 以下)では検索を icon-button にし、操作を 1〜2 つに絞ります。

HTML

<header class="mz-topbar">
  <div class="mz-topbar__lead"><button class="mz-icon-button" type="button" aria-label="明細の一覧に戻る"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button></div>
  <h1 class="mz-topbar__title">11月の明細</h1>
  <div class="mz-topbar__actions">
    <button class="mz-icon-button" type="button" aria-label="明細を探す"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></button>
  </div>
</header>

いつ使うか

  • アプリの各画面の先頭に置き、いまどの画面にいるかと、その画面でよく使う操作を出します。
  • 操作は 1〜2 つにします。ほかは画面の中か、ポップオーバーで開くメニューに置きます。
  • 帯の幅が足りないとき(文字 200% の 390 幅など)は、画面名を 2 行目に下ろします。

読み上げとキーボードにどう応えるか

  • 画面名は、その画面の h1 にします(見本ではページの見出しと重ならないよう h3 にしています)。
  • 戻るボタンには「明細の一覧に戻る」のように、戻る先の名前を付けます。
  • 帯の下の線の動きはスクロールに合わせた不透明度だけで、動きを減らす設定でも意味は変わりません。

よい例と悪い例

家賃

よい例戻るボタンの名前に、戻る先を書く

悪い例画面名がないと、いまどの画面にいて、戻ると何が起きるのかが分からない

更新日

ページの一覧

索引を読み込んでいます。

メニュー