A compact checkout form that prioritizes the selected payment method while keeping alternatives visible but de-emphasized.
HTML
<form class="checkout-priority">
<div class="checkout-priority__methods">
<button class="is-active" type="button">Card</button>
<button type="button">PayPal</button>
</div>
<input type="text" placeholder="Card number">
<button type="submit">Pay $49</button>
</form>CSS
.checkout-priority {
width: 200px;
padding: 0.85rem;
border-radius: 18px;
background: #ffffff;
display: grid;
gap: 0.45rem;
box-shadow: 0 18px 36px rgba(0,0,0,0.14);
}
.checkout-priority__methods {
display: flex;
gap: 0.25rem;
}
.checkout-priority__methods button {
flex: 1;
padding: 0.35rem 0;
border-radius: 999px;
border: none;
background: #f3f4f6;
font-size: 11px;
color: #6b7280;
cursor: pointer;
}
.checkout-priority__methods button.is-active {
background: #6366f1;
color: #ffffff;
font-weight: 600;
}
.checkout-priority input {
padding: 0.45rem 0.5rem;
border-radius: 10px;
border: 1px solid #e5e7eb;
font-size: 12px;
}
.checkout-priority button[type="submit"] {
padding: 0.45rem;
border-radius: 999px;
border: none;
background: #111827;
color: #ffffff;
font-size: 12px;
}
@media (prefers-color-scheme: dark) {
.checkout-priority {
background: #020617;
}
.checkout-priority input {
background: #020617;
color: #e5e7eb;
border-color: #374151;
}
}Notes
- Method prioritization without page change
- Compact and conversion-focused
- Works well in modals and side panels
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.
