This multi-step checkout form breaks payment into stages, improving clarity for longer or complex purchases.
HTML
<div class="checkout-steps">
<!-- Step indicator -->
<div class="steps">
<span class="step active">1</span>
<span class="step">2</span>
<span class="step">3</span>
</div>
<!-- STEP 1: Customer -->
<form class="panel active">
<h3>Customer Details</h3>
<p class="subtitle">Tell us who you are</p>
<input type="text" placeholder="Full name" required>
<input type="email" placeholder="Email address" required>
<button type="button">Continue</button>
</form>
<!-- STEP 2: Payment -->
<form class="panel">
<h3>Payment</h3>
<p class="subtitle">Secure card payment</p>
<input type="text" placeholder="Card number" required>
<div class="row">
<input type="text" placeholder="MM / YY" required>
<input type="text" placeholder="CVC" required>
</div>
<button type="button">Review Order</button>
</form>
<!-- STEP 3: Review -->
<form class="panel">
<h3>Review & Pay</h3>
<p class="subtitle">Confirm your order</p>
<div class="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>
</form>
</div>How it works: Toggle
.activeon.paneland.stepvia JavaScript or backend logic.
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-steps{
max-width:480px;
margin:70px auto;
}
.steps{
display:flex;
justify-content:center;
gap:12px;
margin-bottom:18px;
}
.step{
width:28px;
height:28px;
border-radius:50%;
border:2px solid var(--border);
color:var(--muted);
font-size:13px;
font-weight:600;
display:flex;
align-items:center;
justify-content:center;
}
.step.active{
background:var(--primary);
border-color:var(--primary);
color:#fff;
}
.panel{
display:none;
padding:30px;
background:var(--card);
border-radius:18px;
border:1px solid var(--border);
box-shadow:0 16px 40px rgba(0,0,0,.12);
color:var(--text);
text-align:center;
}
.panel.active{
display:block;
}
.panel h3{
font-size:22px;
margin-bottom:6px;
}
.panel .subtitle{
font-size:14px;
color:var(--muted);
margin-bottom:22px;
}
.panel 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;
}
.panel input::placeholder{
color:var(--muted);
}
.panel 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;
}
.summary{
margin:18px 0;
padding:16px;
border-radius:14px;
border:1px solid var(--border);
background:linear-gradient(180deg,var(--bg),var(--card));
}
.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;
}
.panel button{
width:100%;
padding:15px;
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;
}
.panel button:hover{
transform:translateY(-1px);
box-shadow:0 14px 36px rgba(0,0,0,.22);
}
.panel button:active{
transform:translateY(0);
box-shadow:none;
}
@media (max-width:480px){
.row{
grid-template-columns:1fr;
}
}Notes
- Suitable for complex checkouts
- Reduces cognitive load
- SaaS & enterprise 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.
