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…
Associates a text caption with a form control. Labels are essential for accessibility, enabling screen readers to announce form fields and allowing users to click the label to focus the associated input.
Checkboxes and radio buttons should have labels wrapping them
Any form control that requires user identification
Always provide labels. Forms without labels are inaccessible to screen reader users.
VB Styling
Vanilla Breeze styles labels as display: block with font-weight: 500 and a small bottom margin (var(--size-xs)). When a label contains a checkbox or radio input, VB auto-detects this via :has() and switches to inline-flex with first-baseline alignment (the control lines up with the first line of text, even when the text wraps), gap spacing, a 24px minimum row height and a pointer cursor — no classes needed.
Association Methods
Explicit: Using the for Attribute
The recommended method. The label's forattribute matches the input's id.
The label wraps the input. Useful for checkboxes and radios where text follows the control.
Implicit label association
12345678910
<!-- Text input wrapped --><label> Email Address<inputtype="email" /></label><!-- Checkbox wrapped --><label><inputtype="checkbox" /> I agree to the terms</label>
With Checkboxes and Radios
For checkboxes and radio buttons, wrap the input inside the label. VB auto-detects the contained checkbox or radio via label:has(input[type="checkbox"]) and switches the label to inline-flex with proper alignment and a pointer cursor. No extra classes required.
Checkbox and radio labels
1234567891011121314151617
<!-- Checkbox --><label><inputtype="checkbox"name="feature" /> Enable feature</label><!-- Radio buttons in fieldset, one per row --><fieldset><legend>Select size</legend><layout-stackdata-layout-gap="s"><label><inputtype="radio"name="size"value="small" /> Small</label><label><inputtype="radio"name="size"value="large" /> Large</label></layout-stack></fieldset>
Checkbox and radio labels are inline-flex, so without a wrapper they sit side by side in one row. Wrap them in <layout-stack> to stack them.
Required Field Indicator
Inside <form-field>, the asterisk is automatic. When the field contains a required control, form-field adds a red * after the label (and after the legend of a grouped field). Screen readers do not announce the asterisk, because the control's native required state is announced instead. Keep the label text plain. A typed * would show twice and be read aloud as “star”. Explain the asterisk once at the top of the form.
Required field in form-field
12345
<pclass="help">Fields marked with * are required</p><form-field><labelfor="name">Name</label><inputtype="text"id="name"required /></form-field>
A bare label outside form-field gets no marker. Add your own, hidden from screen readers, and keep required on the control: <label for="name">Name <span aria-hidden="true">*</span></label>.
Visually Hidden Labels
When a label is not visually needed (e.g., a search field with a placeholder), hide it visually but keep it accessible with the .visually-hidden utility class.