탐색

v2.1.0
애플리케이션 블록

선택 카드

네이티브 입력 요소를 감싼 카드에서 요금제, 담당자, 결제 수단을 선택합니다.

선택 카드는 한 문장의 설명이 필요한 결정 하나를 요청합니다. 어떤 요금제를 쓸지, 누가 검토할지, 어떻게 결제할지 등입니다. 각 옵션은 네이티브 라디오 버튼이나 체크박스를 감싼 <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>. legend는 질문이며 라디오 버튼 그룹의 이름이 되므로, 각 옵션은 그 질문에 대한 답으로 읽힙니다. heading heading-sm으로 제목의 서체를 적용합니다.
  • 각 옵션은 선택 옵션입니다. 라디오 버튼은 시작 부분에 놓입니다. 선택한 카드는 살짝 올라오고 윤곽선이 잉크 색으로 바뀌므로 색상을 구별하지 않아도 알아볼 수 있으며, 라디오 버튼 자체의 표시도 같은 내용을 전달합니다.
  • 결정에 필요한 정보는 텍스트로 전달합니다. 제목, 해당하는 경우 가격, 그리고 옵션이 제공하는 내용을 설명하는 한 문장으로 구성됩니다. 현재 요금제나 기본 결제 수단처럼 지금 적용 중인 항목은 첫 줄 끝에 중립색 배지로 표시합니다.
  • 카드는 블록 너비에 따라 다시 배치됩니다. --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>

#결제 수단

저장된 결제 수단 중 하나를 선택합니다. 결제 수단의 이름에는 사용자가 알아볼 수 있는 브랜드와 번호 끝 네 자리를 표시하고, 만료일, 처리 시간, 남은 크레딧 등 수단을 구별하는 정보도 함께 표시합니다. 아이콘 프레임 안의 아이콘은 장식 요소이며, 무엇인지는 제목이 알려 줍니다.

결제 수단

<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>

이 블록은 이미 저장된 결제 수단 중에서만 선택합니다. 카드 번호는 절대 요청하지 않습니다. 결제 수단 추가는 결제 서비스 제공자의 자체 폼이나 페이지에서 처리하며, 카드 번호는 그쪽에서 보관하므로 애플리케이션은 이를 보관하지 않습니다.

#접근성

  • 각 블록은 legend의 id로 이름을 지정한 <section>이며, legend는 그 안의 모든 옵션에 대해 fieldset의 이름이 됩니다.
  • 각 카드 안의 입력 요소는 실제 라디오 버튼이나 체크박스입니다. 라디오 버튼 그룹에서는 방향키로 이동하고, Space 키로 체크박스를 전환하며, 폼을 제출하면 값이 전송됩니다.
  • 카드 전체가 조작 대상이며, 터치 화면에서는 높이가 최소 44px입니다. 포커스 링은 작은 입력 요소가 아니라 카드 둘레에 표시됩니다.
  • 선택 상태는 입력 요소 자체의 표시와 카드의 잉크 색 윤곽선으로 전달하며, 색상만으로 전달하지 않습니다. 배지는 “현재”와 “기본값”을 텍스트로 표시합니다.
  • 이름 옆의 아바타는 장식 요소입니다. alt는 비워 두고 이니셜에는 aria-hidden을 지정합니다.