メニュー

シート

画面の右か下から重ねて開く面です。ダイアログより長い中身や、詳しい情報に使います。

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

右からのシートは幅 min(480, 画面の幅)・高さいっぱい、下からのシート(スマホの既定)は幅いっぱい・高さ 90% までで、上につまみを置きます。面はどちらも不透明の raised です。

右から

家賃の明細

日付
11/20(金)
金額
−78,000円
口座
給与の口座
分類
住まい・家賃
メモ
12月分。更新料は2027年3月。

下から

家賃の明細

日付
11/20(金)
金額
−78,000円
口座
給与の口座
分類
住まい・家賃
メモ
12月分。更新料は2027年3月。

開く操作

家賃の明細

日付
11/20(金)
金額
−78,000円
口座
給与の口座
分類
住まい・家賃
メモ
12月分。更新料は2027年3月。

コードを写す

HTML

<button class="mz-button" type="button" commandfor="sheet-r-light" command="show-modal" data-demo-open="sheet-right">家賃の明細を見る</button>

<dialog class="mz-sheet" id="sheet-r-light" data-side="right" data-demo="sheet-right" aria-labelledby="sheet-r-light-title">
  <span class="mz-sheet__grabber" aria-hidden="true"></span>
  <div class="mz-sheet__header">
    <h2 class="mz-sheet__title" id="sheet-r-light-title">家賃の明細</h2>
    <button class="mz-icon-button mz-sheet__close" type="button" aria-label="閉じる" commandfor="sheet-r-light" command="close"><svg class="" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
  </div>
  <div class="mz-sheet__body" tabindex="0" role="group" aria-label="家賃の明細の中身(入らないときは横にスクロールします)" data-scroll-frame>
    <dl class="mz-kv">
      <div class="mz-kv__row"><dt>日付</dt><dd>11/20(金)</dd></div>
      <div class="mz-kv__row"><dt>金額</dt><dd><span class="mz-num">−78,000</span><span class="mz-kv__unit">円</span></dd></div>
      <div class="mz-kv__row"><dt>口座</dt><dd>給与の口座</dd></div>
      <div class="mz-kv__row"><dt>分類</dt><dd>住まい・家賃</dd></div>
      <div class="mz-kv__row"><dt>メモ</dt><dd>12月分。更新料は2027年3月。</dd></div>
    </dl>
  </div>
  <div class="mz-sheet__footer">
    <div class="mz-button-group">
      <button class="mz-button" data-variant="quiet" type="button" commandfor="sheet-r-light" command="close">閉じる</button>
      <button class="mz-button" data-variant="primary" type="button" commandfor="sheet-r-light" command="close">分類を変える</button>
    </div>
  </div>
</dialog>

つまみ(__grabber)は下からのシートでだけ見えます。開き方はダイアログと同じです。

いつ使うか

  • 一覧の 1件の詳しい中身、絞り込みの条件など、画面を移らずに見せたい長めの中身に使います。
  • スマホでは下から、広い画面では右から出すのが既定です。
  • 取り消せない操作の確認だけなら、ダイアログにします。

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

  • ダイアログと同じく、ネイティブの <dialog> を showModal() で開きます。Esc で閉じ、フォーカスは開いたボタンへ戻ります。
  • 名前は aria-labelledby で見出しと結びます。つまみは飾りなので aria-hidden="true" にします。

よい例と悪い例

家賃の明細

日付
11/20(金)
分類
住まい・家賃
メモ
12月分。更新料は2027年3月。
よい例1件の詳しい中身は、シートに見出しと項目で並べる

家賃の明細

日付
11/20(金)
分類
住まい・家賃
口座
給与の口座
メモ
12月分。更新料は2027年3月。
悪い例詳しい中身をダイアログに詰めると、確かめる問いと操作が埋もれる

更新日

ページの一覧

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

メニュー