Choice cards
Plans, people and payment methods to choose, as cards around native inputs.
Choice cards ask for one decision that needs a sentence to make: which plan, who reviews, how to pay. Each option is a choice, a <label> around a native radio or checkbox, so the whole card is the target and the input keeps the state, the keys and the form value. No script is needed.
Plans
<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>Blocks are markup to copy. They take the page's own text color and size; the previews set fg-text-body text-sm on the body. Each block is a size container, so it reflows by its own width: in a wide page, a sidebar's worth of room or a dialog.
#What is in it
- A
<fieldset>with a<legend>. The legend is the question and names the group of radios, so each option is read as an answer to it. It takes the heading's type withheading heading-sm. - Each option is a choice. The radio sits at its start; a chosen card rises and its contour turns to ink, which a reader sees without hue, and the radio's own mark says the same.
- The words carry the decision. A title, a price where there is one, and one sentence on what the option gives. What applies now, the current plan or the default method, is a neutral badge at the end of the first line.
- The cards reflow by the block's width.
auto-grid auto-grid-fitwith--auto-grid-minsets the plans side by side in a wide room, sharing the whole row, and one under another in a narrow one; no breakpoint is written. - The summary agrees with the choice. The line before the action says what the chosen option costs with the seats there are, and the action names it.
#People
Checkboxes when several can be chosen: who reviews, who is notified. Each card holds the person's avatar, their name and their role. A line under the cards says how many are chosen and what that means, and the fieldset is described by it.
People
<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>#Payment methods
Saved methods to pay with, one at a time. A method is named by what a reader recognizes, the brand and the last four figures, and what makes it differ: when it expires, how long it takes, how much credit is left. The icon in an icon frame is decoration; the title says what it is.
Payment methods
<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>The block chooses among methods that are already saved. It never asks for a card number: adding a method is the payment provider's own form or page, which holds the number so the application never does.
#Accessibility
- Each block is a
<section>named by its legend's id, and the legend names the fieldset for every option in it. - The input inside each card is a real radio or checkbox: the arrow keys move within a group of radios, Space toggles a checkbox, and a form submits the value.
- The whole card is the target, at least 44px tall on a touch screen; the focus ring is drawn around the card, not the small input.
- What is chosen is told by the input's own mark and the card's ink contour, never by color alone. Badges say "Current" and "Default" in words.
- An avatar beside a name is decoration: its
altis empty, and initials arearia-hidden.
#Related
- SurfaceTrays, sheets and wells: the material ladder every component is built on.
- HeadingA title in the ink of the page, with the line over it and the paragraph under it.
- InputText fields cut into the surface, with labels, hints, errors and groups.
- ChoiceA radio or checkbox option large enough to explain itself.
- RadioA small round well for one choice among several.
- CheckboxA small native well that fills with ink when checked.
- PriceWhat something costs, set the way a price is read.
- BadgeA small chip for a status, a category or a count.
- AvatarA person or a team as a photo or initials, alone or stacked.
- Icon frameA small well that holds an icon at its size beside a heading.
- ButtonA raised control that lifts on hover and sinks when pressed.