CSS Shipping Options Radio

A stacked list of checkout shipping options with delivery times and prices, built on real radio buttons.

  • radio
  • shipping
  • checkout
  • delivery
  • option list
  • has
HTML
<fieldset class="ship-opts">
  <legend>Shipping method</legend>
  <label>
    <input type="radio" name="ship" checked>
    <span><strong>Standard</strong>4–6 business days</span>
    <b>Free</b>
  </label>
  <label>
    <input type="radio" name="ship">
    <span><strong>Express</strong>1–2 business days</span>
    <b>$9.90</b>
  </label>
  <label>
    <input type="radio" name="ship">
    <span><strong>Same day</strong>Order before 2 PM</span>
    <b>$19</b>
  </label>
</fieldset>
CSS
.ship-opts {
  width: 100%;
  max-width: 300px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #0f172a;
  font-family: system-ui, sans-serif;
}

.ship-opts legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}

.ship-opts label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -1px;
  padding: 11px 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.ship-opts label:first-of-type {
  border-radius: 12px 12px 0 0;
}

.ship-opts label:last-of-type {
  border-radius: 0 0 12px 12px;
}

.ship-opts label:has(:checked) {
  z-index: 1;
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.ship-opts input {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
}

.ship-opts input:checked {
  border-color: #0ea5e9;
}

.ship-opts input:checked::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
}

.ship-opts input:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.ship-opts span {
  display: grid;
  flex: 1;
  color: #64748b;
  font-size: 12px;
}

.ship-opts strong {
  color: #0f172a;
  font-size: 14px;
}

.ship-opts b {
  font-size: 14px;
}

About this CSS Shipping Options Radio

This CSS Shipping Options Radio is 88 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses CSS Grid, Flexbox, the :has() selector and the :checked state (no JavaScript). It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #0f172a
  • #e2e8f0
  • #fff
  • #0ea5e9
  • #f0f9ff
  • #cbd5e1
  • #64748b

How to use this shipping options radio

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .ship-opts class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback