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.
Displays the result of a calculation or user action. Semantically ideal for form validation messages, computed values, and dynamic results. Used extensively in the form-field custom element for validation feedback.
The <output> element is purpose-built for displaying results of calculations and user actions. It has three advantages that <div> and <span> lack:
aria-live by default: Output has an implicit aria-live="polite" role, so screen readers announce changes automaticallyfor attribute: Directly associates the result with the input(s) that produced it, giving assistive technology a clear relationship| Approach | Semantics | Accessibility | Recommendation |
|---|---|---|---|
<output> |
Result of action | Native support with for attribute |
Recommended |
<span class="error"> |
None | Requires manual ARIA | Avoid |
<div class="message"> |
None | Requires manual ARIA | Avoid |
Vanilla Breeze styles output as an inline-block element with monospace font, subtle raised background, and small border radius. Display a simple calculated or dynamic value:
<label>Calculated Total</label><output>$124.99</output>
| Attribute | Purpose | Example |
|---|---|---|
for |
Space-separated IDs of related inputs | for="qty price" |
form |
Associates with a form by ID | form="order-form" |
name |
Name for form submission | name="total" |
Four CSS classes control presentation:
| Class | Effect |
|---|---|
| (default) | Inline monospace with subtle raised background |
.block |
display: block with larger padding for full-width output |
.inline |
No padding or background — blends into surrounding text |
.highlight |
Brand-tinted background with interactive color text |
.large |
Increased font size (var(--font-size-xl)) for prominent values |
<output>Default</output><output class="block">Block output</output><output class="inline">Inline</output><output class="highlight">Highlighted</output><output class="large">Large</output>
Variants can be combined: class="large highlight" or class="block success".
Semantic colors for different message types. Each state uses an OKLCH-based tinted background with matching text color.
| Class | Use Case |
|---|---|
.success |
Confirmations, completed operations (green tones) |
.warning |
Caution messages, pending review (amber tones) |
.error |
Validation errors, failures (red tones) |
<output class="success">Operation completed</output><output class="warning">Please review</output><output class="error">Invalid input</output>
The primary use case in Vanilla Breeze. Pair with form-field and aria-describedby for CSS-only validation feedback.
<form-field> <label for="email">Email</label> <input type="email" id="email" required aria-describedby="email-msg" /> <output id="email-msg" for="email" aria-live="polite"> Enter a valid email address </output></form-field>
Display the current value of a range input. The for attribute links the output to its source.
<label>Volume: <output id="volume">50</output>%</label><input type="range" min="0" max="100" value="50" oninput="document.getElementById('volume').value = this.value" />
Display computed results from multiple inputs. The for attribute accepts a space-separated list of input IDs.
<input type="number" id="qty" value="2" /><input type="number" id="price" value="29.99" /><output for="qty price" class="large highlight">$59.98</output>
Use aria-live="polite" for dynamic content that should be announced by screen readers when it changes.
<output class="success" aria-live="polite">Connected</output><output aria-live="polite">All changes saved</output>
for attribute: Associates output with related input(s) for assistive technologyaria-live: Use polite for updates that should be announced (output has implicit live region semantics, but explicit is clearer)aria-describedby: Connect inputs to their validation outputs so screen readers announce the message when the input is focusedoutput { display: inline-block; font-family: var(--font-mono); padding: var(--size-2xs) var(--size-xs); background: var(--color-surface-raised); border-radius: var(--radius-s);} /* --- Style Variants --- */ output.block { display: block; padding: var(--size-s) var(--size-m);} output.inline { padding: 0; background: transparent;} output.highlight { background: oklch(from var(--color-interactive) l c h / 0.1); color: var(--color-interactive);} output.large { font-size: var(--font-size-xl); padding: var(--size-s) var(--size-m);} /* --- State Variants --- */ output.success { background: oklch(60% 0.18 145 / 0.1); color: oklch(45% 0.15 145);} output.warning { background: oklch(75% 0.18 75 / 0.1); color: oklch(55% 0.15 75);} output.error { background: oklch(55% 0.2 25 / 0.1); color: oklch(50% 0.18 25);}