` rows for the order summary; `
` for the security note
- `` for security indicators
- Proper `autocomplete` attributes for address and payment autofill
- `inputmode="numeric"` for mobile keyboard optimization
## Single-Page Checkout
A complete checkout form on a single page, using `` to group contact, shipping, and payment sections. Centered with `data-layout="center"` and wrapped in a `` for visual containment. Ideal for simpler purchases or when you want to minimize steps.
VB provides native `` styling (border, radius, padding, legend formatting). These overrides increase the padding and legend font size for a more spacious checkout layout, and tint the `` security note:
checkout-single.html:
```html
```
Fieldset customization:
```css
/* Override VB native fieldset padding and legend size */
fieldset {
padding: var(--size-l);
}
fieldset legend {
font-size: var(--font-size-m);
}
/* Security note: muted small print with a green lock */
fieldset small {
color: var(--color-text-muted);
}
fieldset small icon-wc {
color: var(--color-success);
}
```
## Split Layout with Order Summary
A two-column layout using `data-layout="sidebar"` with the checkout form in a `` and an order summary ``. The sidebar layout automatically recognizes these semantic elements for content vs sidebar sizing. The order summary is a description list: each `` pairs a `
` label (item details in ``) with its `` price, laid out as a `data-layout="cluster"` row. Native ` ` elements provide visual dividers.
Complete your purchase by providing shipping and payment information.
Your payment information is encrypted and secure.
## Order summary
Layout is handled entirely by `data-layout` attributes. These element styles cover only the visual details (no classes needed):
Order summary styling:
```css
/* Each dl group is a cluster row; drop the default dd indent */
aside dd {
margin: 0;
white-space: nowrap;
}
/* Item details sit under the name as muted small print */
aside dt small {
display: block;
font-weight: normal;
color: var(--color-text-muted);
}
aside hr {
margin-block: 0;
}
```
## Multi-Step Checkout
A wizard-style checkout flow with a visual step indicator. Breaks the checkout into Shipping, Payment, and Review steps. Uses `data-layout="cluster"` for the progress indicator. Reduces cognitive load by focusing on one section at a time.
The step indicator uses `nav.steps` from VB core — no custom CSS needed. See the Steps pattern for all variants and customization.
checkout-steps.html:
```html
Checkout
Step 1 of 3: Shipping
Shipping
Payment
Review
```
No custom CSS required:
```css
/* No custom CSS needed — nav.steps is included in VB core.
Numbered circles, connectors, and checkmarks are automatic.
See the Steps pattern page for all variants and CSS variables. */
```
## Configuration
Key configuration options for checkout forms:
## Usage Notes
- Never store raw credit card numbers on your server
- Use a payment processor (Stripe, Braintree, etc.) with hosted fields or tokenization
- These patterns show the form structure; actual payment handling requires integration with a PCI-compliant payment gateway
- Display security indicators (lock icon, "encrypted" messaging) to build user trust
- Use proper `autocomplete` values: `address-line1` (street), `address-level2` (city), `address-level1` (state), `postal-code`, `country-name`
- Consider integrating address verification services (Google Places, SmartyStreets) for accuracy
- Support international addresses with flexible field requirements
- Add a checkbox "Billing address same as shipping" to reduce form fields
- Show/hide billing address section based on checkbox state
- Pre-populate billing fields when checkbox is unchecked
- Validate card numbers with Luhn algorithm
- Check expiration date is in the future
- Validate ZIP/postal codes based on selected country
- Show inline validation errors using ``
- `` and `` provide semantic grouping for screen readers
- All inputs have associated labels
- Error messages linked via `aria-describedby`
- Step indicator uses `aria-current="step"` for current step
- Progress is announced with descriptive step text (e.g., "Step 1 of 3: Shipping")
## Related
Step indicator CSS pattern used in multi-step checkout
Sign up forms with multi-step flows
Form field element with validation
Sidebar layout for split designs
Icon component for security indicators
---
# Contact Form Patterns
Contact form patterns with split layouts, contact information sidebars, and map integration. Accessible and responsive designs for customer communication.
- Documentation: https://vanilla-breeze.com/docs/patterns/forms/contact/
- Vanilla Breeze 0.7.4
## Overview
Contact forms are essential for user communication. These patterns demonstrate various layouts from simple centered forms to complex split designs with contact information and map placeholders.
Key features:
- `` for consistent input styling and validation
- `