ナビゲーション

v2.1.0
アプリケーションのブロック

選択カード

ネイティブの入力要素を囲むカードで、プラン、メンバー、支払い方法を選択します。

選択カードでは、各選択肢に短い説明を添え、利用者に 1 つの判断を求めます。どのプランにするか、誰がレビューするか、どの方法で支払うかなどです。各選択肢は選択肢コンポーネントで、ネイティブのラジオボタンまたはチェックボックスを <label> で囲みます。そのため、カード全体が操作対象になり、状態、キー操作、フォームの値は入力要素が管理します。スクリプトは不要です。

プラン

<section class="sheet container-inline p-lg" aria-labelledby="cc-plan-title">  <form class="flex flex-col gap-md">    <fieldset class="fieldset gap-sm">      <legend class="fieldset-legend heading heading-sm" id="cc-plan-title">        Choose a plan for Atlas Labs      </legend>      <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 12rem">        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="hobby">          <span class="choice-body">            <span class="choice-title">Hobby</span>            <span class="price price-sm">              <span class="price-currency">$</span><span class="price-amount">0</span><span class="price-period">per month</span>            </span>            <span class="choice-description">One project, previews for every branch.</span>          </span>        </label>        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="pro" checked>          <span class="choice-body">            <span class="choice-title">Pro</span>            <span class="price price-sm">              <span class="price-currency">$</span><span class="price-amount">20</span><span class="price-period">per seat a month</span>            </span>            <span class="choice-description">              Unlimited projects, fourteen regions and 400 build minutes a seat.            </span>          </span>          <span class="choice-end"><span class="badge badge-sm">Current</span></span>        </label>        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="enterprise">          <span class="choice-body">            <span class="choice-title">Enterprise</span>            <span class="price price-sm"><span class="price-amount">Custom</span></span>            <span class="choice-description">              From 5 seats, single sign-on, an audit log and a 99.99% uptime agreement.            </span>          </span>        </label>      </div>    </fieldset>    <div class="flex flex-wrap items-center justify-between gap-sm">      <p class="m(0) fg-text-muted">Pro, 5 seats: $100 a month, billed on the 1st.</p>      <button class="btn btn-primary btn-sm">Keep Pro</button>    </div>  </form></section>
<section className="sheet container-inline p-lg" aria-labelledby="cc-plan-title">  <form className="flex flex-col gap-md">    <fieldset className="fieldset gap-sm">      <legend className="fieldset-legend heading heading-sm" id="cc-plan-title">        Choose a plan for Atlas Labs      </legend>      <div className="auto-grid auto-grid-fit gap-sm" style={{ '--auto-grid-min': '12rem' } as React.CSSProperties}>        <label className="choice">          <input type="radio" className="radio" name="cc-plan" value="hobby" />          <span className="choice-body">            <span className="choice-title">Hobby</span>            <span className="price price-sm">              <span className="price-currency">$</span><span className="price-amount">0</span><span className="price-period">per month</span>            </span>            <span className="choice-description">One project, previews for every branch.</span>          </span>        </label>        <label className="choice">          <input type="radio" className="radio" name="cc-plan" value="pro" defaultChecked />          <span className="choice-body">            <span className="choice-title">Pro</span>            <span className="price price-sm">              <span className="price-currency">$</span><span className="price-amount">20</span><span className="price-period">per seat a month</span>            </span>            <span className="choice-description">              Unlimited projects, fourteen regions and 400 build minutes a seat.            </span>          </span>          <span className="choice-end"><span className="badge badge-sm">Current</span></span>        </label>        <label className="choice">          <input type="radio" className="radio" name="cc-plan" value="enterprise" />          <span className="choice-body">            <span className="choice-title">Enterprise</span>            <span className="price price-sm"><span className="price-amount">Custom</span></span>            <span className="choice-description">              From 5 seats, single sign-on, an audit log and a 99.99% uptime agreement.            </span>          </span>        </label>      </div>    </fieldset>    <div className="flex flex-wrap items-center justify-between gap-sm">      <p className="m(0) fg-text-muted">Pro, 5 seats: $100 a month, billed on the 1st.</p>      <button className="btn btn-primary btn-sm">Keep Pro</button>    </div>  </form></section>
<section class="sheet container-inline p-lg" aria-labelledby="cc-plan-title">  <form class="flex flex-col gap-md">    <fieldset class="fieldset gap-sm">      <legend class="fieldset-legend heading heading-sm" id="cc-plan-title">        Choose a plan for Atlas Labs      </legend>      <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 12rem">        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="hobby">          <span class="choice-body">            <span class="choice-title">Hobby</span>            <span class="price price-sm">              <span class="price-currency">$</span><span class="price-amount">0</span><span class="price-period">per month</span>            </span>            <span class="choice-description">One project, previews for every branch.</span>          </span>        </label>        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="pro" checked>          <span class="choice-body">            <span class="choice-title">Pro</span>            <span class="price price-sm">              <span class="price-currency">$</span><span class="price-amount">20</span><span class="price-period">per seat a month</span>            </span>            <span class="choice-description">              Unlimited projects, fourteen regions and 400 build minutes a seat.            </span>          </span>          <span class="choice-end"><span class="badge badge-sm">Current</span></span>        </label>        <label class="choice">          <input type="radio" class="radio" name="cc-plan" value="enterprise">          <span class="choice-body">            <span class="choice-title">Enterprise</span>            <span class="price price-sm"><span class="price-amount">Custom</span></span>            <span class="choice-description">              From 5 seats, single sign-on, an audit log and a 99.99% uptime agreement.            </span>          </span>        </label>      </div>    </fieldset>    <div class="flex flex-wrap items-center justify-between gap-sm">      <p class="m(0) fg-text-muted">Pro, 5 seats: $100 a month, billed on the 1st.</p>      <button class="btn btn-primary btn-sm">Keep Pro</button>    </div>  </form></section>
<template>  <section class="sheet container-inline p-lg" aria-labelledby="cc-plan-title">    <form class="flex flex-col gap-md">      <fieldset class="fieldset gap-sm">        <legend class="fieldset-legend heading heading-sm" id="cc-plan-title">          Choose a plan for Atlas Labs        </legend>        <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 12rem">          <label class="choice">            <input type="radio" class="radio" name="cc-plan" value="hobby">            <span class="choice-body">              <span class="choice-title">Hobby</span>              <span class="price price-sm">                <span class="price-currency">$</span><span class="price-amount">0</span><span class="price-period">per month</span>              </span>              <span class="choice-description">One project, previews for every branch.</span>            </span>          </label>          <label class="choice">            <input type="radio" class="radio" name="cc-plan" value="pro" checked>            <span class="choice-body">              <span class="choice-title">Pro</span>              <span class="price price-sm">                <span class="price-currency">$</span><span class="price-amount">20</span><span class="price-period">per seat a month</span>              </span>              <span class="choice-description">                Unlimited projects, fourteen regions and 400 build minutes a seat.              </span>            </span>            <span class="choice-end"><span class="badge badge-sm">Current</span></span>          </label>          <label class="choice">            <input type="radio" class="radio" name="cc-plan" value="enterprise">            <span class="choice-body">              <span class="choice-title">Enterprise</span>              <span class="price price-sm"><span class="price-amount">Custom</span></span>              <span class="choice-description">                From 5 seats, single sign-on, an audit log and a 99.99% uptime agreement.              </span>            </span>          </label>        </div>      </fieldset>      <div class="flex flex-wrap items-center justify-between gap-sm">        <p class="m(0) fg-text-muted">Pro, 5 seats: $100 a month, billed on the 1st.</p>        <button class="btn btn-primary btn-sm">Keep Pro</button>      </div>    </form>  </section></template>

ブロックはコピーして使えるマークアップです。文字色と文字サイズはページから引き継ぎます。プレビューでは body に fg-text-body text-sm を設定しています。各ブロックはサイズコンテナーで、広いページでも、サイドバーほどの幅でも、ダイアログ内でも、自身の幅に応じて配置が変わります。

#構成

  • <legend> を備えた <fieldset>。 レジェンドは質問で、ラジオボタンのグループに名前を付けるため、各選択肢はその質問への答えとして読み上げられます。heading heading-sm で見出しと同じ文字スタイルにします。
  • 各選択肢は選択肢コンポーネントです。 ラジオボタンは先頭に置きます。選択したカードは浮き上がり、輪郭がインク色に変わるため、色相に頼らずに見分けられます。ラジオボタン自体のマークも同じことを伝えます。
  • 判断材料は文言で伝えます。 タイトル、該当する場合は価格、選択肢で得られるものを 1 文で書きます。現在のプランや既定の支払い方法など、現在適用されているものは、1 行目の末尾にニュートラルなバッジで示します。
  • カードはブロックの幅に応じて配置が変わります。 --auto-grid-min を指定した auto-grid auto-grid-fit により、広い領域ではプランが行全体を分け合って横に並び、狭い領域では縦に並びます。ブレークポイントは書きません。
  • 概要は選択と一致します。 操作ボタンの前の行には、選択内容と現在の席数に基づく料金を示します。ボタンの文言にも、選択した項目の名前を入れます。

#メンバー

複数を選べる場合はチェックボックスを使います。誰がレビューするか、誰に通知するかなどです。各カードには、その人のアバター、名前、役割を入れます。カードの下の行で、何人を選んだかとその意味を伝え、fieldset の説明としてその行を参照します。

メンバー

<section class="sheet container-inline p-lg" aria-labelledby="cc-people-title">  <fieldset class="fieldset gap-sm" aria-describedby="cc-people-count">    <legend class="fieldset-legend heading heading-sm" id="cc-people-title">      Who reviews deployments to production?    </legend>    <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 16rem">      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="yiching@atlaslabs.dev" checked>        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Yi-ching Lin</span>          <span class="choice-description">Owner</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="misaki@atlaslabs.dev" checked>        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/misaki-sato.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Misaki Sato</span>          <span class="choice-description">Admin</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="jihoon@atlaslabs.dev">        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/jihoon-park.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Ji-hoon Park</span>          <span class="choice-description">Member</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="kenta@atlaslabs.dev">        <span class="avatar avatar-sm" aria-hidden="true">KN</span>        <span class="choice-body">          <span class="choice-title">Kenta Nakamura</span>          <span class="choice-description">Member</span>        </span>      </label>    </div>    <p class="m(0) fg-text-muted" id="cc-people-count">      2 of 4 people review. One approval is enough to deploy.    </p>  </fieldset></section>
<section className="sheet container-inline p-lg" aria-labelledby="cc-people-title">  <fieldset className="fieldset gap-sm" aria-describedby="cc-people-count">    <legend className="fieldset-legend heading heading-sm" id="cc-people-title">      Who reviews deployments to production?    </legend>    <div className="auto-grid auto-grid-fit gap-sm" style={{ '--auto-grid-min': '16rem' } as React.CSSProperties}>      <label className="choice items-center">        <input type="checkbox" className="checkbox" name="cc-reviewers" value="yiching@atlaslabs.dev" defaultChecked />        <span className="avatar avatar-sm">          <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="256" height="256" />        </span>        <span className="choice-body">          <span className="choice-title">Yi-ching Lin</span>          <span className="choice-description">Owner</span>        </span>      </label>      <label className="choice items-center">        <input type="checkbox" className="checkbox" name="cc-reviewers" value="misaki@atlaslabs.dev" defaultChecked />        <span className="avatar avatar-sm">          <img className="avatar-image" src="/demo/people/misaki-sato.webp" alt="" width="256" height="256" />        </span>        <span className="choice-body">          <span className="choice-title">Misaki Sato</span>          <span className="choice-description">Admin</span>        </span>      </label>      <label className="choice items-center">        <input type="checkbox" className="checkbox" name="cc-reviewers" value="jihoon@atlaslabs.dev" />        <span className="avatar avatar-sm">          <img className="avatar-image" src="/demo/people/jihoon-park.webp" alt="" width="256" height="256" />        </span>        <span className="choice-body">          <span className="choice-title">Ji-hoon Park</span>          <span className="choice-description">Member</span>        </span>      </label>      <label className="choice items-center">        <input type="checkbox" className="checkbox" name="cc-reviewers" value="kenta@atlaslabs.dev" />        <span className="avatar avatar-sm" aria-hidden="true">KN</span>        <span className="choice-body">          <span className="choice-title">Kenta Nakamura</span>          <span className="choice-description">Member</span>        </span>      </label>    </div>    <p className="m(0) fg-text-muted" id="cc-people-count">      2 of 4 people review. One approval is enough to deploy.    </p>  </fieldset></section>
<section class="sheet container-inline p-lg" aria-labelledby="cc-people-title">  <fieldset class="fieldset gap-sm" aria-describedby="cc-people-count">    <legend class="fieldset-legend heading heading-sm" id="cc-people-title">      Who reviews deployments to production?    </legend>    <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 16rem">      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="yiching@atlaslabs.dev" checked>        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Yi-ching Lin</span>          <span class="choice-description">Owner</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="misaki@atlaslabs.dev" checked>        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/misaki-sato.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Misaki Sato</span>          <span class="choice-description">Admin</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="jihoon@atlaslabs.dev">        <span class="avatar avatar-sm">          <img class="avatar-image" src="/demo/people/jihoon-park.webp" alt width="256" height="256">        </span>        <span class="choice-body">          <span class="choice-title">Ji-hoon Park</span>          <span class="choice-description">Member</span>        </span>      </label>      <label class="choice items-center">        <input type="checkbox" class="checkbox" name="cc-reviewers" value="kenta@atlaslabs.dev">        <span class="avatar avatar-sm" aria-hidden="true">KN</span>        <span class="choice-body">          <span class="choice-title">Kenta Nakamura</span>          <span class="choice-description">Member</span>        </span>      </label>    </div>    <p class="m(0) fg-text-muted" id="cc-people-count">      2 of 4 people review. One approval is enough to deploy.    </p>  </fieldset></section>
<template>  <section class="sheet container-inline p-lg" aria-labelledby="cc-people-title">    <fieldset class="fieldset gap-sm" aria-describedby="cc-people-count">      <legend class="fieldset-legend heading heading-sm" id="cc-people-title">        Who reviews deployments to production?      </legend>      <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 16rem">        <label class="choice items-center">          <input type="checkbox" class="checkbox" name="cc-reviewers" value="yiching@atlaslabs.dev" checked>          <span class="avatar avatar-sm">            <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="256" height="256">          </span>          <span class="choice-body">            <span class="choice-title">Yi-ching Lin</span>            <span class="choice-description">Owner</span>          </span>        </label>        <label class="choice items-center">          <input type="checkbox" class="checkbox" name="cc-reviewers" value="misaki@atlaslabs.dev" checked>          <span class="avatar avatar-sm">            <img class="avatar-image" src="/demo/people/misaki-sato.webp" alt width="256" height="256">          </span>          <span class="choice-body">            <span class="choice-title">Misaki Sato</span>            <span class="choice-description">Admin</span>          </span>        </label>        <label class="choice items-center">          <input type="checkbox" class="checkbox" name="cc-reviewers" value="jihoon@atlaslabs.dev">          <span class="avatar avatar-sm">            <img class="avatar-image" src="/demo/people/jihoon-park.webp" alt width="256" height="256">          </span>          <span class="choice-body">            <span class="choice-title">Ji-hoon Park</span>            <span class="choice-description">Member</span>          </span>        </label>        <label class="choice items-center">          <input type="checkbox" class="checkbox" name="cc-reviewers" value="kenta@atlaslabs.dev">          <span class="avatar avatar-sm" aria-hidden="true">KN</span>          <span class="choice-body">            <span class="choice-title">Kenta Nakamura</span>            <span class="choice-description">Member</span>          </span>        </label>      </div>      <p class="m(0) fg-text-muted" id="cc-people-count">        2 of 4 people review. One approval is enough to deploy.      </p>    </fieldset>  </section></template>

#支払い方法

保存済みの支払い方法から 1 つを選びます。支払い方法には、ブランドとカード番号の下 4 桁など、読み手が見て分かる名前を付け、有効期限、処理にかかる時間、残りのクレジットなど、違いが分かる情報を添えます。アイコンフレームの中のアイコンは装飾で、何の方法かはタイトルで伝えます。

支払い方法

<section class="sheet container-inline p-lg" aria-labelledby="cc-method-title">  <form class="flex flex-col gap-md">    <fieldset class="fieldset gap-sm">      <legend class="fieldset-legend heading heading-sm" id="cc-method-title">        Pay the invoice of November with      </legend>      <div class="flex flex-col gap-xs">        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="visa-ending-in-4821" checked>          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">              <rect x="1.6667" y="3.3333" width="12.6667" height="9.3333" rx="1" /><path d="M1.6667 6.6667L14.3333 6.6667" /><path d="M4 10L6.6667 10" />            </svg>          </span>          <span class="choice-body">            <span class="choice-title">Visa ending in 4821</span>            <span class="choice-description">Expires 08/2028</span>          </span>          <span class="choice-end"><span class="badge badge-sm">Default</span></span>        </label>        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="bank-account-ending-in-7310">          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">              <path d="M2.6747 4.9585L7.9029 2.054A0.2 0.2 0 0 1 8.0971 2.054L13.3253 4.9585A0.2 0.2 0 0 1 13.2282 5.3333L2.7718 5.3333A0.2 0.2 0 0 1 2.6747 4.9585Z" /><path d="M4 7.3333L4 11.6667" /><path d="M8 7.3333L8 11.6667" /><path d="M12 7.3333L12 11.6667" /><path d="M2 14L14 14" />            </svg>          </span>          <span class="choice-body">            <span class="choice-title">Bank account ending in 7310</span>            <span class="choice-description">Direct debit, 3 days to settle</span>          </span>        </label>        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="atlas-credit">          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">              <rect x="2" y="5.3333" width="12" height="2.6667" rx="0.8" /><path d="M3.3333 8L3.3333 13A1 1 0 0 0 4.3333 14L11.6667 14A1 1 0 0 0 12.6667 13L12.6667 8" /><path d="M8 5.3333L8 14" /><path d="M8 5.3333C5.3333 5.3333 3.6667 4.6667 3.6667 3C3.6667 0.6667 7.3333 1.6667 8 5.3333C8.6667 1.6667 12.3333 0.6667 12.3333 3C12.3333 4.6667 10.6667 5.3333 8 5.3333" />            </svg>          </span>          <span class="choice-body">            <span class="choice-title">Atlas credit</span>            <span class="choice-description">$120.00 left, until 31 March</span>          </span>        </label>      </div>    </fieldset>    <div class="flex flex-wrap items-center justify-between gap-sm">      <a class="btn btn-quiet btn-sm" href="#cc-method-title">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M3 8L13 8" /><path d="M8 3L8 13" />        </svg>Add a payment method      </a>      <button class="btn btn-primary btn-sm">Pay $100.00</button>    </div>  </form></section>
import CreditCardIcon from '@master/icons-react/native/16/soft/credit-card'import LandmarkIcon from '@master/icons-react/native/16/soft/landmark'import GiftIcon from '@master/icons-react/native/16/soft/gift'import PlusIcon from '@master/icons-react/native/16/soft/plus'<section className="sheet container-inline p-lg" aria-labelledby="cc-method-title">  <form className="flex flex-col gap-md">    <fieldset className="fieldset gap-sm">      <legend className="fieldset-legend heading heading-sm" id="cc-method-title">        Pay the invoice of November with      </legend>      <div className="flex flex-col gap-xs">        <label className="choice items-center">          <input type="radio" className="radio" name="cc-method" value="visa-ending-in-4821" defaultChecked />          <span className="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <CreditCardIcon className="icon" />          </span>          <span className="choice-body">            <span className="choice-title">Visa ending in 4821</span>            <span className="choice-description">Expires 08/2028</span>          </span>          <span className="choice-end"><span className="badge badge-sm">Default</span></span>        </label>        <label className="choice items-center">          <input type="radio" className="radio" name="cc-method" value="bank-account-ending-in-7310" />          <span className="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <LandmarkIcon className="icon" />          </span>          <span className="choice-body">            <span className="choice-title">Bank account ending in 7310</span>            <span className="choice-description">Direct debit, 3 days to settle</span>          </span>        </label>        <label className="choice items-center">          <input type="radio" className="radio" name="cc-method" value="atlas-credit" />          <span className="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <GiftIcon className="icon" />          </span>          <span className="choice-body">            <span className="choice-title">Atlas credit</span>            <span className="choice-description">$120.00 left, until 31 March</span>          </span>        </label>      </div>    </fieldset>    <div className="flex flex-wrap items-center justify-between gap-sm">      <a className="btn btn-quiet btn-sm" href="#cc-method-title">        <PlusIcon className="icon" />Add a payment method      </a>      <button className="btn btn-primary btn-sm">Pay $100.00</button>    </div>  </form></section>
<script>  import CreditCardIcon from '@master/icons-svelte/native/16/soft/credit-card'  import LandmarkIcon from '@master/icons-svelte/native/16/soft/landmark'  import GiftIcon from '@master/icons-svelte/native/16/soft/gift'  import PlusIcon from '@master/icons-svelte/native/16/soft/plus'</script><section class="sheet container-inline p-lg" aria-labelledby="cc-method-title">  <form class="flex flex-col gap-md">    <fieldset class="fieldset gap-sm">      <legend class="fieldset-legend heading heading-sm" id="cc-method-title">        Pay the invoice of November with      </legend>      <div class="flex flex-col gap-xs">        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="visa-ending-in-4821" checked>          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <CreditCardIcon class="icon" />          </span>          <span class="choice-body">            <span class="choice-title">Visa ending in 4821</span>            <span class="choice-description">Expires 08/2028</span>          </span>          <span class="choice-end"><span class="badge badge-sm">Default</span></span>        </label>        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="bank-account-ending-in-7310">          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <LandmarkIcon class="icon" />          </span>          <span class="choice-body">            <span class="choice-title">Bank account ending in 7310</span>            <span class="choice-description">Direct debit, 3 days to settle</span>          </span>        </label>        <label class="choice items-center">          <input type="radio" class="radio" name="cc-method" value="atlas-credit">          <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">            <GiftIcon class="icon" />          </span>          <span class="choice-body">            <span class="choice-title">Atlas credit</span>            <span class="choice-description">$120.00 left, until 31 March</span>          </span>        </label>      </div>    </fieldset>    <div class="flex flex-wrap items-center justify-between gap-sm">      <a class="btn btn-quiet btn-sm" href="#cc-method-title">        <PlusIcon class="icon" />Add a payment method      </a>      <button class="btn btn-primary btn-sm">Pay $100.00</button>    </div>  </form></section>
<script setup>import CreditCardIcon from '@master/icons-vue/native/16/soft/credit-card'import LandmarkIcon from '@master/icons-vue/native/16/soft/landmark'import GiftIcon from '@master/icons-vue/native/16/soft/gift'import PlusIcon from '@master/icons-vue/native/16/soft/plus'</script><template>  <section class="sheet container-inline p-lg" aria-labelledby="cc-method-title">    <form class="flex flex-col gap-md">      <fieldset class="fieldset gap-sm">        <legend class="fieldset-legend heading heading-sm" id="cc-method-title">          Pay the invoice of November with        </legend>        <div class="flex flex-col gap-xs">          <label class="choice items-center">            <input type="radio" class="radio" name="cc-method" value="visa-ending-in-4821" checked>            <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">              <CreditCardIcon class="icon" />            </span>            <span class="choice-body">              <span class="choice-title">Visa ending in 4821</span>              <span class="choice-description">Expires 08/2028</span>            </span>            <span class="choice-end"><span class="badge badge-sm">Default</span></span>          </label>          <label class="choice items-center">            <input type="radio" class="radio" name="cc-method" value="bank-account-ending-in-7310">            <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">              <LandmarkIcon class="icon" />            </span>            <span class="choice-body">              <span class="choice-title">Bank account ending in 7310</span>              <span class="choice-description">Direct debit, 3 days to settle</span>            </span>          </label>          <label class="choice items-center">            <input type="radio" class="radio" name="cc-method" value="atlas-credit">            <span class="icon-frame icon-frame-xs icon-frame-raised" aria-hidden="true">              <GiftIcon class="icon" />            </span>            <span class="choice-body">              <span class="choice-title">Atlas credit</span>              <span class="choice-description">$120.00 left, until 31 March</span>            </span>          </label>        </div>      </fieldset>      <div class="flex flex-wrap items-center justify-between gap-sm">        <a class="btn btn-quiet btn-sm" href="#cc-method-title">          <PlusIcon class="icon" />Add a payment method        </a>        <button class="btn btn-primary btn-sm">Pay $100.00</button>      </div>    </form>  </section></template>

このブロックは、保存済みの支払い方法から選ぶためのものです。カード番号を尋ねることはありません。支払い方法の追加は決済プロバイダー自身のフォームやページで行います。番号を保持するのはプロバイダーで、アプリケーションが保持することはありません。

#アクセシビリティ

  • 各ブロックは、レジェンドの id で名前を付けた <section> です。レジェンドは、その中のすべての選択肢に対して fieldset の名前になります。
  • 各カード内の入力要素は、本物のラジオボタンまたはチェックボックスです。ラジオボタンのグループ内では矢印キーで移動し、チェックボックスは Space キーで切り替え、フォームは値を送信します。
  • カード全体が操作対象で、タッチ画面では高さが 44px 以上になります。フォーカスリングは小さな入力要素ではなく、カードの周囲に描画されます。
  • 選択中であることは、入力要素自体のマークとカードのインク色の輪郭で伝え、色だけに頼ることはしません。バッジは「Current」や「Default」を文言で示します。
  • 名前の横にあるアバターは装飾です。alt は空にし、イニシャルには aria-hidden を付けます。