Skip to content
IndexRequest a UIAboutContact

Selectable Card

A group of cards where exactly one can be chosen, built on real radio inputs.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Create a selectable card group with three plans: Basic ($0), Plus ($8 per month) and Team ($20 per month). Use a fieldset with a legend "Choose a plan", and for each plan a label that wraps a visually hidden radio input (same name) and a card showing the plan name in 14px semibold, a one-line description in 12px secondary text, the price on the right and a circular check badge in the top right corner. The selected card (use :has(input:checked) or a sibling selector) gets a 2px dark border and a very light background; the check badge scales from 0.6 to 1 in 200ms with cubic-bezier(.3,1.4,.5,1). Hover darkens the 1px border. Focus-visible on the input draws a 2px ring around the card. Arrow keys must move the selection natively. Cards stack under 480px. Disabled option supported with 40% opacity. Under prefers-reduced-motion remove the scale animation.

About this pattern

Definition

Cards that behave like radio buttons. Each card holds a title and details; choosing one marks it as selected with a stronger border and a check mark.

Purpose & UX principles

  • Presents choices with enough room for explanation, such as plans or delivery options.
  • Built on native radio inputs inside labels, so keyboard arrows, grouping and form submission work without extra code.
  • Selection is shown by border, background and a check icon, not by colour alone.

Interaction states

  • Unselected, hover (border darkens), selected (2px border, check visible), focus-visible (ring on the card), disabled.

Motion specification

  • Border and background: 160ms ease.
  • Check mark: scale from 0.6 to 1 in 200ms with a slight overshoot.
  • Reduced motion: no scaling, instant state change.

Responsive behaviour

  • Cards sit in a row on wide screens and stack on narrow ones.
  • Each card is at least 64px tall, with the whole card clickable.

Code

HTML
<fieldset class="grp">
  <legend>Choose a plan</legend>
  <label class="opt"><input type="radio" name="plan" checked><span class="c"><span class="t"><b>Basic</b><small>For trying things out</small></span><span class="p">$0</span><i class="ck" aria-hidden="true">✓</i></span></label>
  <label class="opt"><input type="radio" name="plan"><span class="c"><span class="t"><b>Plus</b><small>For individual makers</small></span><span class="p">$8<small>/mo</small></span><i class="ck" aria-hidden="true">✓</i></span></label>
  <label class="opt"><input type="radio" name="plan"><span class="c"><span class="t"><b>Team</b><small>Shared libraries</small></span><span class="p">$20<small>/mo</small></span><i class="ck" aria-hidden="true">✓</i></span></label>
</fieldset>

Related patterns

Interactive Card

↗
Interactive CardCards & Containers

Radio Button

↗
Radio ButtonInputs & Forms

Accordion

↗
AccordionCards & Containers