質感
区切り線
セクションを分ける細い線です。ラベルを付けることもできます。
このページの内容
区切り線は、セクションの間に引く細い線です。既定で separator ロールを持つ<hr>に.dividerを指定します。線は境界を最もはっきり示す手段なので、余白やグループ化だけでは区切りが伝わりにくいときに使います。
区切り線
<p class="m(0) text-sm fg-text-body">Billing is managed by the workspace owner.</p><hr class="divider"><p class="m(0) text-sm fg-text-body">Invoices are sent on the first day of each month.</p><> <p className="m(0) text-sm fg-text-body">Billing is managed by the workspace owner.</p> <hr className="divider" /> <p className="m(0) text-sm fg-text-body">Invoices are sent on the first day of each month.</p></><p class="m(0) text-sm fg-text-body">Billing is managed by the workspace owner.</p><hr class="divider"><p class="m(0) text-sm fg-text-body">Invoices are sent on the first day of each month.</p><template> <p class="m(0) text-sm fg-text-body">Billing is managed by the workspace owner.</p> <hr class="divider"> <p class="m(0) text-sm fg-text-body">Invoices are sent on the first day of each month.</p></template>#ラベル付き
divider-labelはラベルの両側に線を引きます。<hr>にはテキストを入れられないため、role="separator"を指定した要素に適用します。
ラベル付き
<button type="button" class="btn w-full">Continue with a passkey</button><div class="divider divider-label" role="separator">or</div><input class="input" type="email" placeholder="you@example.com" aria-label="Email"><> <button type="button" className="btn w-full">Continue with a passkey</button> <div className="divider divider-label" role="separator">or</div> <input className="input" type="email" placeholder="you@example.com" aria-label="Email" /></><button type="button" class="btn w-full">Continue with a passkey</button><div class="divider divider-label" role="separator">or</div><input class="input" type="email" placeholder="you@example.com" aria-label="Email"><template> <button type="button" class="btn w-full">Continue with a passkey</button> <div class="divider divider-label" role="separator">or</div> <input class="input" type="email" placeholder="you@example.com" aria-label="Email"></template>#縦の区切り線
divider-verticalは横並びの項目の間に置く区切り線で、行全体の高さに伸びます。操作要素のグループを区切る場合はrole="separator"とaria-orientation="vertical"を指定し、見た目の区切りとしてのみ使う場合はaria-hidden="true"で支援技術から隠します。
縦の区切り線
<div class="flex items-center gap-sm"> <button type="button" class="btn btn-quiet btn-sm">Edit</button> <span class="divider divider-vertical" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm">Share</button> <button type="button" class="btn btn-quiet btn-sm">Export</button></div><div className="flex items-center gap-sm"> <button type="button" className="btn btn-quiet btn-sm">Edit</button> <span className="divider divider-vertical" role="separator" aria-orientation="vertical"></span> <button type="button" className="btn btn-quiet btn-sm">Share</button> <button type="button" className="btn btn-quiet btn-sm">Export</button></div><div class="flex items-center gap-sm"> <button type="button" class="btn btn-quiet btn-sm">Edit</button> <span class="divider divider-vertical" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm">Share</button> <button type="button" class="btn btn-quiet btn-sm">Export</button></div><template> <div class="flex items-center gap-sm"> <button type="button" class="btn btn-quiet btn-sm">Edit</button> <span class="divider divider-vertical" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm">Share</button> <button type="button" class="btn btn-quiet btn-sm">Export</button> </div></template>#クラス
| クラス | 説明 |
|---|---|
divider | --color-line-dividerの1px罫線 |
divider-vertical | 同じ行の項目を区切る線です。高さは行と同じです。divider と併用します |
divider-label | 「または」などのキャプションを挟んで線が分かれます。hr にはテキストを入れられないため、role="separator"を持つ要素に適用します。divider と併用します |