0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Checkout form patterns with single-page, split layout, and multi-step flows. Accessible and secure payment form designs.
Overview
Checkout forms are critical for e-commerce success. These patterns demonstrate best practices for collecting shipping and payment information while maintaining user trust and a smooth experience using Vanilla Breeze components.
Key features:
<fieldset> with <legend> for semantic grouping of related fields
<form-field> for consistent input styling and validation
data-layout="sidebar" with <main> and <aside> for order summary placement
data-layout="split" for side-by-side fields (city/state, expiry/CVC)
<dl> with <div> rows for the order summary; <small> for the security note
<icon-wc name="lock"> 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 <fieldset> to group contact, shipping, and payment sections. Centered with data-layout="center" and wrapped in a <layout-card> for visual containment. Ideal for simpler purchases or when you want to minimize steps.
<body><maindata-layout="center"data-layout-max="narrow"><layout-carddata-padding="l"><formaction="/checkout"method="POST"data-layout="stack"data-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Checkout</h1><p>Complete your purchase by providing the information below.</p></header><!-- Contact Information --><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Contact information</legend><form-field><labelfor="email">Email address</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"aria-describedby="email-error"/><outputid="email-error"class="error"for="email"aria-live="polite"> Please enter a valid email address.</output></form-field></fieldset><!-- Shipping Address --><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Shipping address</legend><form-field><labelfor="full-name">Full name</label><inputtype="text"id="full-name"name="full_name"requiredautocomplete="name"placeholder="John Doe"/></form-field><form-field><labelfor="address">Street address</label><inputtype="text"id="address"name="address"requiredautocomplete="address-line1"placeholder="123 Main St"/></form-field><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="city">City</label><inputtype="text"id="city"name="city"requiredautocomplete="address-level2"placeholder="San Francisco"/></form-field><form-field><labelfor="state">State / Province</label><inputtype="text"id="state"name="state"requiredautocomplete="address-level1"placeholder="CA"/></form-field></layout-grid><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="zip">ZIP / Postal code</label><inputtype="text"id="zip"name="zip"requiredautocomplete="postal-code"placeholder="94102"/></form-field><form-field><labelfor="country">Country</label><selectid="country"name="country"requiredautocomplete="country-name"><optionvalue="">Select country</option><optionvalue="US"selected>United States</option><optionvalue="CA">Canada</option><optionvalue="GB">United Kingdom</option></select></form-field></layout-grid></fieldset><!-- Payment Information --><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Payment</legend><form-field><labelfor="card-number">Card number</label><inputtype="text"id="card-number"name="card_number"requiredautocomplete="cc-number"placeholder="1234 5678 9012 3456"inputmode="numeric"/></form-field><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="expiry">Expiration date</label><inputtype="text"id="expiry"name="expiry"requiredautocomplete="cc-exp"placeholder="MM / YY"inputmode="numeric"/></form-field><form-field><labelfor="cvc">CVC</label><inputtype="text"id="cvc"name="cvc"requiredautocomplete="cc-csc"placeholder="123"inputmode="numeric"maxlength="4"/></form-field></layout-grid><p><smalldata-layout="cluster"data-layout-gap="xs"data-layout-align="center"><icon-wcname="lock"></icon-wc> Your payment information is encrypted and secure.</small></p></fieldset><buttontype="submit">Place order</button></form></layout-card></main></body>
Fieldset Styles
VB provides native <fieldset> styling (border, radius, padding, legend formatting). These overrides increase the padding and legend font size for a more spacious checkout layout, and tint the <small> security note:
Fieldset customization
/* Override VB native fieldset padding and legend size */fieldset {padding: var(--size-l);}fieldsetlegend {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 <main> and an order summary <aside>. The sidebar layout automatically recognizes these semantic elements for content vs sidebar sizing. The order summary is a description list: each <div> pairs a <dt> label (item details in <small>) with its <dd> price, laid out as a data-layout="cluster" row. Native <hr> elements provide visual dividers.
<bodydata-layout="sidebar"data-layout-gap="xl"data-layout-content-min="l"><!-- Checkout Form --><maindata-layout="stack"data-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Checkout</h1><p>Complete your purchase by providing shipping and payment information.</p></header><formaction="/checkout"method="POST"data-layout="stack"data-layout-gap="l"><!-- Shipping Address --><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Shipping address</legend><form-field><labelfor="email">Email address</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"/></form-field><form-field><labelfor="full-name">Full name</label><inputtype="text"id="full-name"name="full_name"requiredautocomplete="name"placeholder="John Doe"/></form-field><form-field><labelfor="address">Street address</label><inputtype="text"id="address"name="address"requiredautocomplete="address-line1"placeholder="123 Main St"/></form-field><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="city">City</label><inputtype="text"id="city"name="city"requiredautocomplete="address-level2"placeholder="San Francisco"/></form-field><form-field><labelfor="state">State</label><inputtype="text"id="state"name="state"requiredautocomplete="address-level1"placeholder="CA"/></form-field></layout-grid><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="zip">ZIP code</label><inputtype="text"id="zip"name="zip"requiredautocomplete="postal-code"placeholder="94102"/></form-field><form-field><labelfor="country">Country</label><selectid="country"name="country"required><optionvalue="">Select country</option><optionvalue="US"selected>United States</option><optionvalue="CA">Canada</option></select></form-field></layout-grid></fieldset><!-- Payment Information --><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Payment</legend><form-field><labelfor="card-number">Card number</label><inputtype="text"id="card-number"name="card_number"requiredautocomplete="cc-number"placeholder="1234 5678 9012 3456"inputmode="numeric"/></form-field><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="expiry">Expiration</label><inputtype="text"id="expiry"name="expiry"requiredautocomplete="cc-exp"placeholder="MM / YY"/></form-field><form-field><labelfor="cvc">CVC</label><inputtype="text"id="cvc"name="cvc"requiredautocomplete="cc-csc"placeholder="123"maxlength="4"/></form-field></layout-grid><p><smalldata-layout="cluster"data-layout-gap="xs"data-layout-align="center"><icon-wcname="lock"></icon-wc> Your payment information is encrypted and secure.</small></p></fieldset><buttontype="submit">Place order</button></form></main><!-- Order Summary Sidebar --><asidedata-layout="stack"data-layout-gap="l"><h2>Order summary</h2><dldata-layout="stack"data-layout-gap="s"><divdata-layout="cluster"data-layout-justify="between"data-layout-align="start"data-layout-gap="m"><dt>Premium Wireless Headphones <small>Black, Qty: 1</small></dt><dd>$249.00</dd></div><!-- More items... --></dl><hr/><dldata-layout="stack"data-layout-gap="s"><divdata-layout="cluster"data-layout-justify="between"data-layout-align="start"data-layout-gap="m"><dt>Subtotal</dt><dd>$327.98</dd></div><divdata-layout="cluster"data-layout-justify="between"data-layout-align="start"data-layout-gap="m"><dt>Shipping</dt><dd>$9.99</dd></div><divdata-layout="cluster"data-layout-justify="between"data-layout-align="start"data-layout-gap="m"><dt>Tax</dt><dd>$27.12</dd></div></dl><hr/><dldata-layout="stack"data-layout-gap="s"><divdata-layout="cluster"data-layout-justify="between"data-layout-align="start"data-layout-gap="m"><dt><strong>Total</strong></dt><dd><strong>$365.09</strong></dd></div></dl></aside></body>
Order Summary Styles
Layout is handled entirely by data-layout attributes. These element styles cover only the visual details (no classes needed):
Order summary styling
/* Each dl group is a cluster row; drop the default dd indent */asidedd {margin: 0;white-space: nowrap;}/* Item details sit under the name as muted small print */asidedt 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.
<body><maindata-layout="center"data-layout-max="narrow"><layout-carddata-padding="l"><layout-stackdata-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Checkout</h1><p>Step 1 of 3: Shipping</p></header><!-- Step Indicator — uses nav.steps from VB core --><navclass="steps"aria-label="Checkout progress"><ol><liaria-current="step">Shipping</li><li>Payment</li><li>Review</li></ol></nav><!-- Step 1: Shipping --><formaction="/checkout/shipping"method="POST"data-layout="stack"data-layout-gap="l"><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Contact information</legend><form-field><labelfor="email">Email address</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"/></form-field><form-field><labelfor="phone">Phone number</label><inputtype="tel"id="phone"name="phone"autocomplete="tel"placeholder="(555) 123-4567"/></form-field></fieldset><fieldsetdata-layout="stack"data-layout-gap="m"><legend>Shipping address</legend><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="first-name">First name</label><inputtype="text"id="first-name"name="first_name"requiredautocomplete="given-name"placeholder="John"/></form-field><form-field><labelfor="last-name">Last name</label><inputtype="text"id="last-name"name="last_name"requiredautocomplete="family-name"placeholder="Doe"/></form-field></layout-grid><form-field><labelfor="address">Street address</label><inputtype="text"id="address"name="address"requiredautocomplete="address-line1"placeholder="123 Main St"/></form-field><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="city">City</label><inputtype="text"id="city"name="city"requiredautocomplete="address-level2"placeholder="San Francisco"/></form-field><form-field><labelfor="state">State</label><selectid="state"name="state"requiredautocomplete="address-level1"><optionvalue="">Select state</option><optionvalue="CA"selected>California</option></select></form-field></layout-grid><layout-griddata-layout-min="xs"data-layout-gap="m"><form-field><labelfor="zip">ZIP code</label><inputtype="text"id="zip"name="zip"requiredautocomplete="postal-code"placeholder="94102"/></form-field><form-field><labelfor="country">Country</label><selectid="country"name="country"required><optionvalue="US"selected>United States</option><optionvalue="CA">Canada</option></select></form-field></layout-grid></fieldset><layout-clusterdata-layout-justify="between"data-layout-gap="m"><ahref="/cart"class="button secondary">Back to cart</a><buttontype="submit">Continue to payment</button></layout-cluster></form></layout-stack></layout-card></main></body>
Step Indicator
The step indicator uses nav.steps from VB core — no custom CSS needed. See the Steps pattern for all variants and customization.
No custom CSS required
/* 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. */