#122 ui light mobile: high Forms & Commerce

Single-Page Collapsible Accordion Checkout

Single-page accordion checkout where completed steps collapse into scannable summary rows with one-tap Edit.

Inspired by Everlane ↗

Download .html
Fullscreen ↗

WHY THIS AESTHETIC IS UNIQUE

Combines the focus of multi-step checkout with the orientation of a single page—shoppers always see what is done, what is next, and can edit any section without page reloads.

BEST FOR

Direct-to-consumer e-commerceSaaS plan & billing upgradesEvent & travel booking flowsSubscription box signups

TAGS

COLOR PALETTE (CLICK TO COPY HEX)

TYPOGRAPHY

Display
Plus Jakarta Sans
Body
Inter
Mono
JetBrains Mono
Scale
Tracked uppercase brand wordmark, 15-16px accordion headers, and calm 13px summary previews.

Google Fonts Stylesheet ↗

ARCHITECTURE & MOBILE NOTES

LAYOUT

Collapsible top Order Summary strip on mobile that transforms into a sticky right-hand summary rail on desktop, paired with a 4-step accordion stack.

INTERACTION

Advancing a step marks it complete with a checkmark badge, writes a concise one-line summary into its collapsed header, and smoothly opens the next step; changing shipping updates totals immediately.

MOBILE

All inputs and radio cards are >=46-54px tall, single-column on mobile, with a persistent top bag total toggle.

AI AGENT GUARDRAILS

DO

  • Render a concise one-line summary of the user's entered values inside every collapsed completed step
  • Keep a clear Edit affordance on completed steps so users can revisit earlier choices without losing progress
  • Reflect shipping or promo changes immediately in both mobile bag bar and desktop summary rail

DON'T

  • Do not lock completed accordion steps so users have to refresh to fix a typo in their address
  • Do not force mobile shoppers to scroll past a huge expanded cart list before seeing Step 1
STANDALONE SOURCE · demos/collapsible-accordion-checkout.html (18.7 KB)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Single-Page Collapsible Accordion Checkout</title>
<style>
  :root {
    --canvas: #F7F6F3;
    --surface: #FFFFFF;
    --ink: #171715;
    --accent: #3F4F3B;
    --muted: #6F6E68;
    --border: #E5E3DC;
    --radius: 14px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }
  header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .wordmark {
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 0.9rem;
    text-transform: uppercase;
  }
  .secure-pill {
    font-size: 0.76rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  /* Mobile collapsible order summary strip */
  .mobile-bag-bar {
    background: #EFECE6;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: none;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
  }
  @media (min-width: 900px) {
    .mobile-bag-bar { display: none; }
  }
  .mobile-bag-drawer {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
  }
  .mobile-bag-drawer.open { display: block; }
  @media (min-width: 900px) {
    .mobile-bag-drawer.open { display: none; }
  }

  .checkout-grid {
    max-width: 1060px;
    margin: 0 auto;
    padding: 20px 16px 96px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  @media (min-width: 900px) {
    .checkout-grid {
      grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
      padding: 36px 28px 80px;
      align-items: start;
      gap: 36px;
    }
  }

  .accordion-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .step-card.active {
    border-color: var(--ink);
    box-shadow: 0 10px 28px rgba(23, 23, 21, 0.06);
  }
  .step-header {
    width: 100%;
    min-height: 60px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    font: inherit;
  }
  .step-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .step-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
  }
  .step-card.active .step-num {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
  }
  .step-card.done .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .step-title-group { min-width: 0; }
  .step-title {
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .step-summary {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
  }
  .edit-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: underline;
    color: var(--muted);
    flex-shrink: 0;
  }
  .step-card.active .edit-label { display: none; }

  .step-body {
    display: none;
    padding: 4px 18px 20px;
    border-top: 1px solid #F0EEE8;
  }
  .step-card.active .step-body { display: block; }

  .field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  @media (min-width: 540px) {
    .field-grid.two { grid-template-columns: 1fr 1fr; }
  }
  label.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
  }
  input[type="text"], input[type="email"] {
    min-height: 46px;
    padding: 0 13px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #FDFCFA;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
  }
  input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
  }

  .radio-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
  }
  .radio-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
  .radio-card.selected {
    border-color: var(--ink);
    background: #FAF9F6;
  }
  .radio-card input { accent-color: var(--ink); width: 18px; height: 18px; }
  .radio-info { flex: 1; }
  .radio-info strong { display: block; font-size: 0.88rem; }
  .radio-info span { font-size: 0.76rem; color: var(--muted); }
  .radio-price { font-weight: 700; font-size: 0.88rem; }

  .continue-btn {
    margin-top: 18px;
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: none;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
  }
  .continue-btn:hover { opacity: 0.9; }
  .continue-btn:active { transform: scale(0.99); }
  .continue-btn.accent { background: var(--accent); }

  /* Desktop Summary Rail */
  aside.order-rail {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 24px;
  }
  @media (min-width: 900px) {
    aside.order-rail { display: block; }
  }
  .bag-item {
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }
  .garment-thumb {
    width: 60px;
    height: 72px;
    border-radius: 10px;
    background: #ECEAE3;
    flex-shrink: 0;
    display: grid;
    place-items: center;
  }
  .bag-meta { flex: 1; font-size: 0.86rem; }
  .bag-meta strong { display: block; }
  .bag-meta span { color: var(--muted); font-size: 0.78rem; }
  .totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 8px;
  }
  .totals-row.grand {
    color: var(--ink);
    font-weight: 800;
    font-size: 1.05rem;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
  }

  .confirmation-box {
    display: none;
    background: #EDF3EC;
    border: 1px solid #C5D6C1;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
  }
  .confirmation-box.show { display: block; }
  .confirmation-box h2 { font-size: 1.15rem; color: var(--accent); margin-bottom: 6px; }
  .confirmation-box p { font-size: 0.88rem; color: var(--ink); }
</style>
</head>
<body>
  <header>
    <div class="wordmark">ATELIER NORD</div>
    <div class="secure-pill">
      <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg>
      <span>Encrypted Checkout</span>
    </div>
  </header>

  <button id="mobileBagBtn" class="mobile-bag-bar" type="button" aria-expanded="false">
    <span><strong>Order Summary</strong> (2 items) <span id="mobileBagChevron">▾</span></span>
    <strong id="mobileTotalLabel">$218.00</strong>
  </button>
  <div id="mobileBagDrawer" class="mobile-bag-drawer"></div>

  <main class="checkout-grid">
    <section class="accordion-stack" aria-label="Checkout steps">
      <!-- Step 1 -->
      <article class="step-card done" data-step="1">
        <button class="step-header" type="button" aria-expanded="false">
          <div class="step-left">
            <span class="step-num">✓</span>
            <div class="step-title-group">
              <div class="step-title">1. Contact & Delivery</div>
              <div class="step-summary" id="sum1">claire.vance@studio.co · 418 Mercer St, Portland OR</div>
            </div>
          </div>
          <span class="edit-label">Edit</span>
        </button>
        <div class="step-body">
          <div class="field-grid">
            <label class="field">Email address
              <input id="emailInput" type="email" value="claire.vance@studio.co">
            </label>
          </div>
          <div class="field-grid two">
            <label class="field">Full name
              <input id="nameInput" type="text" value="Claire Vance">
            </label>
            <label class="field">Street address
              <input id="addrInput" type="text" value="418 Mercer St, Portland OR">
            </label>
          </div>
          <button class="continue-btn" data-next="2" type="button">Save & Continue to Shipping</button>
        </div>
      </article>

      <!-- Step 2 -->
      <article class="step-card active" data-step="2">
        <button class="step-header" type="button" aria-expanded="true">
          <div class="step-left">
            <span class="step-num">2</span>
            <div class="step-title-group">
              <div class="step-title">2. Shipping Method</div>
              <div class="step-summary" id="sum2">Carbon-Neutral Ground · Free</div>
            </div>
          </div>
          <span class="edit-label">Edit</span>
        </button>
        <div class="step-body">
          <div class="radio-stack" id="shipOptions">
            <label class="radio-card selected">
              <input type="radio" name="ship" value="0" data-label="Carbon-Neutral Ground · Free" checked>
              <div class="radio-info">
                <strong>Carbon-Neutral Ground</strong>
                <span>Arrives Thu–Fri (4–5 business days)</span>
              </div>
              <span class="radio-price">Free</span>
            </label>
            <label class="radio-card">
              <input type="radio" name="ship" value="14" data-label="Express Air (2 Days) · $14">
              <div class="radio-info">
                <strong>Express Air (2 Days)</strong>
                <span>Arrives Tue by 5:00 PM</span>
              </div>
              <span class="radio-price">$14.00</span>
            </label>
            <label class="radio-card">
              <input type="radio" name="ship" value="0" data-label="Showroom Pickup · Free">
              <div class="radio-info">
                <strong>Pearl District Showroom Pickup</strong>
                <span>Ready today in 2 hours</span>
              </div>
              <span class="radio-price">Free</span>
            </label>
          </div>
          <button class="continue-btn" data-next="3" type="button">Continue to Payment</button>
        </div>
      </article>

      <!-- Step 3 -->
      <article class="step-card" data-step="3">
        <button class="step-header" type="button" aria-expanded="false">
          <div class="step-left">
            <span class="step-num">3</span>
            <div class="step-title-group">
              <div class="step-title">3. Payment Details</div>
              <div class="step-summary" id="sum3">Visa ending in 4242</div>
            </div>
          </div>
          <span class="edit-label">Edit</span>
        </button>
        <div class="step-body">
          <div class="field-grid">
            <label class="field">Card number
              <input id="cardInput" type="text" value="4242 •••• •••• 4242">
            </label>
          </div>
          <div class="field-grid two">
            <label class="field">Expiration
              <input type="text" value="09 / 28">
            </label>
            <label class="field">Security code
              <input type="text" value="842">
            </label>
          </div>
          <button class="continue-btn" data-next="4" type="button">Review Order</button>
        </div>
      </article>

      <!-- Step 4 -->
      <article class="step-card" data-step="4">
        <button class="step-header" type="button" aria-expanded="false">
          <div class="step-left">
            <span class="step-num">4</span>
            <div class="step-title-group">
              <div class="step-title">4. Final Review</div>
              <div class="step-summary" id="sum4">Ready to place order</div>
            </div>
          </div>
          <span class="edit-label">Edit</span>
        </button>
        <div class="step-body">
          <p style="font-size:0.86rem;color:var(--muted);margin-top:12px;">
            By placing your order, you agree to 30-day complimentary returns and transparent factory pricing.
          </p>
          <button id="placeOrderBtn" class="continue-btn accent" type="button">Place Order · $218.00</button>
        </div>
      </article>

      <div id="confirmationBox" class="confirmation-box" role="status" aria-live="polite">
        <h2>✓ Order #AN-84920 Confirmed</h2>
        <p id="confirmDesc">Receipt sent to claire.vance@studio.co. You can still inspect or edit steps above to replay the accordion.</p>
      </div>
    </section>

    <aside class="order-rail" id="desktopSummary" aria-label="Order summary"></aside>
  </main>

<script>
(() => {
  const subtotal = 218;
  let shippingCost = 0;

  const cards = [...document.querySelectorAll('.step-card')];
  const desktopSummary = document.getElementById('desktopSummary');
  const mobileBagDrawer = document.getElementById('mobileBagDrawer');
  const mobileBagBtn = document.getElementById('mobileBagBtn');
  const mobileTotalLabel = document.getElementById('mobileTotalLabel');
  const placeOrderBtn = document.getElementById('placeOrderBtn');
  const confirmationBox = document.getElementById('confirmationBox');

  function summaryMarkup() {
    const total = subtotal + shippingCost;
    return `
      <div class="bag-item">
        <div class="garment-thumb" aria-hidden="true">
          <svg width="34" height="42" viewBox="0 0 34 42" fill="none"><path d="M9 5L17 9L25 5L31 12L26 17V38H8V17L3 12L9 5Z" fill="#3F4F3B"/></svg>
        </div>
        <div class="bag-meta">
          <strong>Heavyweight Felted Overshirt</strong>
          <span>Olive Moss · Size M · Qty 1</span>
        </div>
        <strong>$138</strong>
      </div>
      <div class="bag-item">
        <div class="garment-thumb" aria-hidden="true">
          <svg width="34" height="42" viewBox="0 0 34 42" fill="none"><path d="M10 6H24L27 38H20L17 20L14 38H7L10 6Z" fill="#2A2925"/></svg>
        </div>
        <div class="bag-meta">
          <strong>Relaxed Organic Twill Trouser</strong>
          <span>Warm Charcoal · 30×30 · Qty 1</span>
        </div>
        <strong>$80</strong>
      </div>
      <div class="totals-row"><span>Subtotal</span><span>$${subtotal.toFixed(2)}</span></div>
      <div class="totals-row"><span>Shipping</span><span>${shippingCost === 0 ? 'Free' : '$' + shippingCost.toFixed(2)}</span></div>
      <div class="totals-row"><span>Estimated Tax</span><span>Included</span></div>
      <div class="totals-row grand"><span>Total</span><span>$${total.toFixed(2)}</span></div>
    `;
  }

  function renderTotals() {
    const html = summaryMarkup();
    desktopSummary.innerHTML = html;
    mobileBagDrawer.innerHTML = html;
    const totalStr = '$' + (subtotal + shippingCost).toFixed(2);
    mobileTotalLabel.textContent = totalStr;
    placeOrderBtn.textContent = `Place Order · ${totalStr}`;
  }

  function openStep(stepNum) {
    cards.forEach(c => {
      const n = Number(c.dataset.step);
      const isActive = n === stepNum;
      c.classList.toggle('active', isActive);
      c.querySelector('.step-header').setAttribute('aria-expanded', String(isActive));
      if (c.classList.contains('done') && !isActive) {
        c.querySelector('.step-num').textContent = '✓';
      } else {
        c.querySelector('.step-num').textContent = String(n);
      }
    });
  }

  cards.forEach(c => {
    c.querySelector('.step-header').addEventListener('click', () => {
      openStep(Number(c.dataset.step));
    });
  });

  document.querySelectorAll('.continue-btn[data-next]').forEach(btn => {
    btn.addEventListener('click', () => {
      const currentCard = btn.closest('.step-card');
      const curStep = Number(currentCard.dataset.step);
      currentCard.classList.add('done');

      if (curStep === 1) {
        const email = document.getElementById('emailInput').value.trim() || 'claire.vance@studio.co';
        const addr = document.getElementById('addrInput').value.trim() || '418 Mercer St, Portland OR';
        document.getElementById('sum1').textContent = `${email} · ${addr}`;
      } else if (curStep === 2) {
        const checked = document.querySelector('input[name="ship"]:checked');
        document.getElementById('sum2').textContent = checked.dataset.label;
      } else if (curStep === 3) {
        const digits = document.getElementById('cardInput').value.replace(/\D/g, '').slice(-4) || '4242';
        document.getElementById('sum3').textContent = `Card ending in ${digits}`;
      }
      openStep(Number(btn.dataset.next));
    });
  });

  document.querySelectorAll('input[name="ship"]').forEach(radio => {
    radio.addEventListener('change', () => {
      document.querySelectorAll('.radio-card').forEach(rc => rc.classList.remove('selected'));
      radio.closest('.radio-card').classList.add('selected');
      shippingCost = Number(radio.value);
      document.getElementById('sum2').textContent = radio.dataset.label;
      renderTotals();
    });
  });

  mobileBagBtn.addEventListener('click', () => {
    const isOpen = mobileBagDrawer.classList.toggle('open');
    mobileBagBtn.setAttribute('aria-expanded', String(isOpen));
    document.getElementById('mobileBagChevron').textContent = isOpen ? '▴' : '▾';
  });

  placeOrderBtn.addEventListener('click', () => {
    cards.forEach(c => {
      c.classList.remove('active');
      c.classList.add('done');
      c.querySelector('.step-num').textContent = '✓';
    });
    const email = document.getElementById('emailInput').value.trim() || 'claire.vance@studio.co';
    document.getElementById('confirmDesc').textContent =
      `Receipt sent to ${email} for $${(subtotal + shippingCost).toFixed(2)}. Tap any step above to inspect or edit.`;
    confirmationBox.classList.add('show');
  });

  renderTotals();
})();
</script>
</body>
</html>