Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
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.
Always provide labels. Forms without labels are inaccessible to screen reader users.
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 centered alignment, gap spacing, and a pointer cursor — no classes needed.
for AttributeThe recommended method. The label's for attribute matches the input's id.
<label for="name">Full Name</label><input type="text" id="name" />
The label wraps the input. Useful for checkboxes and radios where text follows the control.
<!-- Text input wrapped --><label> Email Address <input type="email" /></label> <!-- Checkbox wrapped --><label> <input type="checkbox" /> I agree to the terms</label>
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 --><label> <input type="checkbox" name="feature" /> Enable feature</label> <!-- Radio buttons in fieldset --><fieldset> <legend>Select size</legend> <label> <input type="radio" name="size" value="small" /> Small </label> <label> <input type="radio" name="size" value="large" /> Large </label></fieldset>
Indicate required fields visually. The asterisk is commonly used but should be explained at the top of the form.
<p class="help">Fields marked with * are required</p><label for="name">Name *</label><input type="text" id="name" required />
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.
<label for="search" class="visually-hidden">Search</label><input type="search" id="search" placeholder="Search..." />
The .visually-hidden class hides the label from sight while keeping it announced by screen readers.
for attribute: Explicit association is clearer and more robust than wrappinglabel { display: block; font-weight: 500; margin-block-end: var(--size-xs);} /* Auto-detected checkbox/radio labels */label:has(input[type="checkbox"]),label:has(input[type="radio"]) { display: inline-flex; align-items: center; gap: var(--size-xs); margin-block-end: 0; cursor: pointer;} /* Within a .group container */.group > label { font-weight: 500; font-size: var(--font-size-sm);} /* Visually hidden but accessible */.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;}
.visually-hidden instead of omitting it