← Back to UI screens

Live: try it with the mouse and the keyboard (Tab, arrows, Escape).

ScreenshotRadio buttons component — mobile, playful style
Theme

Radio buttons component — mobile, playful style

Radio buttons UI component for websites and web apps, shown in Mintwell, a fictional finance product. Shows a radio group of option cards with descriptions, a checked option and a disabled option, plus every state (default, hover, focus-visible, selected, disabled). Playful style: vivid purple, Fredoka headings with Nunito, pill buttons, rounded cards and soft shadows. Comes with copyable HTML, CSS and a few lines of plain JavaScript (keyboard support and ARIA per the WAI-ARIA Authoring Practices), a live demo, and a DESIGN.md with light and dark colour tokens.

Open live HTML ↗ Download DESIGN.md
Pattern
Radio buttons
Device
Mobile
Style
Playful
Product (fictional)
Mintwell
Category
Finance

Spec

Colours (light)
background #fff5eb · surface #fde8d4 · text #2a1906 · muted #755f48 · primary #9354e5 · accent #aa6700
Colours (dark)
background #150800 · surface #231303 · text #f9ede2 · muted #c3ad97 · primary #c9acff · accent #f39600
Fonts
Fredoka (headings), Nunito (body), JetBrains Mono (code) · Google Fonts, under their own licences
Light and dark
Both included; follows the system setting
ARIA pattern
Radio group (WAI-ARIA Authoring Practices)
Keyboard
Arrow keys move and select; native inputs
States
default, hover, focus-visible, selected, disabled
radio-groupmobilefinanceradioform

Code

Paste the HTML where the component goes, the CSS into your stylesheet and the script before </body>. The tokens block holds the light and dark colours; swap in your own.

HTML
<fieldset class="mgd-radio">
  <legend class="mgd-radio__legend">Payout schedule</legend>
  <label class="mgd-radio__opt"><input class="mgd-radio__input" type="radio" name="payout" value="daily" aria-describedby="payout-daily-hint"><span class="mgd-radio__label">Daily</span><span class="mgd-radio__hint" id="payout-daily-hint">Every business day, for balances over $50.</span></label>
  <label class="mgd-radio__opt"><input class="mgd-radio__input" type="radio" name="payout" value="weekly" aria-describedby="payout-weekly-hint" checked><span class="mgd-radio__label">Weekly</span><span class="mgd-radio__hint" id="payout-weekly-hint">Every Monday. Most freelancers pick this.</span></label>
  <label class="mgd-radio__opt"><input class="mgd-radio__input" type="radio" name="payout" value="monthly" aria-describedby="payout-monthly-hint"><span class="mgd-radio__label">Monthly</span><span class="mgd-radio__hint" id="payout-monthly-hint">On the 1st of each month.</span></label>
  <label class="mgd-radio__opt"><input class="mgd-radio__input" type="radio" name="payout" value="instant" aria-describedby="payout-instant-hint" disabled><span class="mgd-radio__label">Instant</span><span class="mgd-radio__hint" id="payout-instant-hint">Not available on the Starter account.</span></label>
</fieldset>
CSS
/* Tokens (light + dark) */
:root{--bg:#fff5eb;--surface:#fde8d4;--border:#ddc7b1;--text:#2a1906;--muted:#755f48;--primary:#9354e5;--on-primary:#ffffff;--accent:#aa6700;--font-h:"Fredoka",Georgia,serif;--font-b:"Nunito",system-ui,sans-serif;--hw:600;
--c-bw:2px;--c-line:transparent;--c-r:14px;--c-pill:999px;--c-sh:0 4px 14px rgb(0 0 0 / .10);--c-pop:0 16px 40px rgb(0 0 0 / .18);--c-tt:none;--c-ls:0;--c-fw:700;--c-fs:14px;--c-ring:3px solid var(--accent);--c-ind:4px;color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#150800;--surface:#231303;--border:#3a2917;--text:#f9ede2;--muted:#c3ad97;--primary:#c9acff;--on-primary:#111111;--accent:#f39600;color-scheme:dark}
}
:root[data-theme="dark"]{--bg:#150800;--surface:#231303;--border:#3a2917;--text:#f9ede2;--muted:#c3ad97;--primary:#c9acff;--on-primary:#111111;--accent:#f39600;color-scheme:dark}

/* Component */
.mgd-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.mgd-radio{margin:0;padding:0;border:0;max-width:560px;display:grid;gap:10px}
.mgd-radio__legend{padding:0;margin:0 0 6px;font:var(--hw) 20px/1.25 var(--font-h)}
.mgd-radio__opt{position:relative;display:grid;grid-template-columns:auto 1fr;gap:4px 12px;align-items:start;padding:14px 16px;background:var(--surface);border:var(--c-bw) solid transparent;border-radius:var(--c-r);box-shadow:var(--c-sh);cursor:pointer;transition:border-color .12s,background-color .12s}
.mgd-radio__opt:hover,.mgd-radio__opt.is-hover{border-color:transparent;background:color-mix(in oklab,var(--primary) 6%,var(--surface))}
.mgd-radio__opt:has(:checked),.mgd-radio__opt.is-on{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary);background:color-mix(in oklab,var(--primary) 8%,var(--surface))}
.mgd-radio__opt:has(:disabled),.mgd-radio__opt.is-off{opacity:.5;cursor:not-allowed;background:var(--surface);border-color:var(--c-line);box-shadow:none}
.mgd-radio__input{appearance:none;-webkit-appearance:none;grid-row:span 2;width:20px;height:20px;margin:2px 0 0;border:2px solid var(--muted);border-radius:50%;background:var(--bg);display:grid;place-items:center;cursor:inherit}
.mgd-radio__input::before{content:"";width:10px;height:10px;border-radius:50%;transform:scale(0);background:var(--primary);transition:transform .12s}
.mgd-radio__input:checked,.mgd-radio__input.is-on{border-color:var(--primary)}
.mgd-radio__input:checked::before,.mgd-radio__input.is-on::before{transform:scale(1)}
.mgd-radio__input:focus-visible,.mgd-radio__input.is-focus{outline:var(--c-ring);outline-offset:3px}
.mgd-radio__label{font:600 15px/1.35 var(--font-b);text-transform:var(--c-tt);letter-spacing:var(--c-ls)}
.mgd-radio__hint{grid-column:2;color:var(--muted);font-size:13px}
@media (forced-colors:active){.mgd-radio__input:checked::before{background:CanvasText}}
@media (prefers-reduced-motion:reduce){.mgd-radio,.mgd-radio *{transition:none!important;animation-duration:2.4s!important}}

No JavaScript needed.

DESIGN.md

Component section (states, ARIA, keyboard)
## Component: Radio buttons

Choose one option from a short list, with descriptions. Native radio inputs, so the browser handles the keyboard.

- **Pattern:** WAI-ARIA Authoring Practices, Radio group (https://www.w3.org/WAI/ARIA/apg/patterns/radio/)
- **Roles and attributes:** A <fieldset> with a <legend> groups native <input type="radio"> controls that share a name; each has a <label> and an aria-describedby hint; a disabled option uses the disabled attribute.
- **States drawn:** default, hover, focus-visible, selected, disabled
- **Focus:** a visible `:focus-visible` outline (3px solid accent), never removed
- **Style knobs (playful):** border 2px, corners 14px, shadow `0 4px 14px rgb(0 0 0 / .10)`, labels sentence case
- **Motion:** transitions are short (≤160ms) and switched off under `prefers-reduced-motion: reduce`
- **Code:** HTML + CSS + no JavaScript; colours come only from the tokens above, so light and dark both work

### Keyboard
- **Tab:** move into the group (to the checked option)
- **Arrow keys:** move and select the previous / next option
- **Space:** select the focused option

### Licence
Original Made Good Designs code: free to use and adapt in any project, including commercial ones, with no credit needed. Fonts are Google Fonts under their own licences.
AI

Build this with your AI

Fonts: Fredoka + Nunito (Google Fonts)

Writing about this component?

More radio buttons components

Radio buttons component — web, playful (Mintwell)
web · playful
Radio buttons component — mobile, minimal (Mintwell)
mobile · minimal
Radio buttons component — mobile, editorial (Mintwell)
mobile · editorial
Radio buttons component — mobile, brutalist (Mintwell)
mobile · brutalist
Radio buttons component — mobile, luxury (Mintwell)
mobile · luxury
Radio buttons component — mobile, corporate (Mintwell)
mobile · corporate
Radio buttons component — mobile, retro (Mintwell)
mobile · retro
Radio buttons component — mobile, monochrome (Mintwell)
mobile · monochrome
Building with an AI coding agent? Every screen here is also in the free Made Good Designs MCP server: ask Claude, Cursor or ChatGPT to search_ui_screens (e.g. “billing settings, editorial style”), get_ui_flow for a whole journey, and get_ui_screen_code to pull the HTML and DESIGN.md straight into your project.

Save to board