One-Page Checkout Form

This one-page checkout form keeps all payment details on a single screen, reducing friction and improving conversion rates.

HTML

<form class="checkout-one">
  <h3>Checkout</h3>
  <p class="subtitle">Complete your purchase</p>

  <!-- Billing -->
  <div class="section">
    <h4>Billing Details</h4>

    <div class="row">
      <input type="text" placeholder="First name" required>
      <input type="text" placeholder="Last name" required>
    </div>

    <input type="email" placeholder="Email address" required>
    <input type="text" placeholder="Street address" required>

    <div class="row">
      <input type="text" placeholder="City" required>
      <input type="text" placeholder="ZIP / Postal code" required>
    </div>
  </div>

  <!-- Payment -->
  <div class="section">
    <h4>Payment</h4>

    <input type="text" placeholder="Card number" required>

    <div class="row">
      <input type="text" placeholder="MM / YY" required>
      <input type="text" placeholder="CVC" required>
    </div>
  </div>

  <!-- Summary -->
  <div class="summary">
    <div><span>Subtotal</span><span>$49.00</span></div>
    <div><span>Tax</span><span>$4.90</span></div>
    <div class="total"><span>Total</span><span>$53.90</span></div>
  </div>

  <button type="button">Pay $53.90</button>

  <p class="note">Secure checkout · SSL encrypted</p>
</form>

Production note: replace type="button" with type="submit" and connect to your payment gateway.

CSS

:root{
  --bg:#f8fafc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#020617;
    --card:#020617;
    --text:#e5e7eb;
    --muted:#94a3b8;
    --border:#1f2937;
    --primary:#3b82f6;
    --primary-dark:#60a5fa;
  }
}

body{
  background:var(--bg);
  font-family:system-ui, -apple-system, sans-serif;
}

.checkout-one{
  max-width:520px;
  margin:60px auto;
  padding:32px;

  background:var(--card);
  border-radius:20px;
  border:1px solid var(--border);
  box-shadow:0 20px 50px rgba(0,0,0,.12);

  color:var(--text);
}

.checkout-one h3{
  font-size:24px;
  margin-bottom:6px;
}

.checkout-one .subtitle{
  font-size:14px;
  color:var(--muted);
  margin-bottom:28px;
}

.section{
  margin-bottom:26px;
}

.section h4{
  font-size:16px;
  margin-bottom:14px;
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}

.checkout-one input{
  width:100%;
  padding:14px 16px;
  margin-bottom:14px;

  border-radius:12px;
  border:1px solid var(--border);
  background:linear-gradient(180deg,var(--card),var(--bg));
  color:var(--text);
  font-size:15px;

  outline:none;
  transition:border .2s ease, box-shadow .2s ease;
}

.checkout-one input::placeholder{
  color:var(--muted);
}

.checkout-one input:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(37,99,235,.18);
}

.summary{
  margin:24px 0;
  padding:16px;
  border-radius:14px;
  background:linear-gradient(180deg,var(--bg),var(--card));
  border:1px solid var(--border);
}

.summary div{
  display:flex;
  justify-content:space-between;
  font-size:14px;
  margin-bottom:8px;
}

.summary .total{
  font-weight:700;
  font-size:16px;
  margin-top:10px;
}

.checkout-one button{
  width:100%;
  padding:16px;

  border:none;
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#fff;

  font-size:16px;
  font-weight:600;
  cursor:pointer;

  transition:transform .15s ease, box-shadow .15s ease;
}

.checkout-one button:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 36px rgba(0,0,0,.22);
}

.checkout-one button:active{
  transform:translateY(0);
  box-shadow:none;
}

.note{
  margin-top:14px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

@media (max-width:520px){
  .row{
    grid-template-columns:1fr;
  }
}

Notes

  • High-conversion pattern
  • Fast checkout flow
  • Ecommerce & SaaS ready

Preview styles shown. Production customization recommended.

Browse More UI Components

Explore hundreds of reusable HTML & CSS UI components built for modern web projects.
Discover buttons, cards, loaders, animations, layouts, and more all with live previews and clean, copy-paste code.

Leave a Reply

Your email address will not be published. Required fields are marked *