Checkout Form with Order Summary

This checkout form includes an order summary section, helping users review their purchase before completing payment.

HTML

<form class="checkout-summary">
  <h3>Checkout</h3>
  <p class="subtitle">Review your order and complete payment</p>

  <!-- Customer Info -->
  <div class="section">
    <h4>Customer Info</h4>
    <input type="text" placeholder="Full name" required>
    <input type="email" placeholder="Email address" required>
  </div>

  <!-- Payment -->
  <div class="section">
    <h4>Payment Details</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>

  <!-- Order Summary -->
  <div class="order-summary">
    <div>
      <span>Product</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 payment · SSL encrypted</p>
</form>

Production note: Change type="button" to type="submit" and integrate with 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-summary{
  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-summary h3{
  font-size:24px;
  margin-bottom:6px;
}

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

.section{
  margin-bottom:26px;
}

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

.checkout-summary 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-summary input::placeholder{
  color:var(--muted);
}

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

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

.order-summary{
  margin:28px 0;
  padding:18px;

  border-radius:14px;
  background:linear-gradient(180deg,var(--bg),var(--card));
  border:1px solid var(--border);
}

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

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

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

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

  color:#ffffff;
  font-size:16px;
  font-weight:600;
  cursor:pointer;

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

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

.checkout-summary 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

  • Reduces checkout anxiety
  • Improves trust
  • Clear pricing visibility

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 *