Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

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…

Read the release notes

fieldset

Groups related form controls together with an optional caption. Essential for organizing complex forms and providing accessible groupings for screen readers.

When to Use

  • Grouping related form fields (e.g., billing address, shipping address)
  • Radio button or checkbox groups that belong together
  • Sections of a multi-part form
  • Any time you need to provide a group label for accessibility

Always include a legend as the first child to provide a caption for the group.

Basic Usage

A fieldset with a legend creates a visually and semantically grouped form section.

Style Variants

Default (Bordered)

Standard fieldset with a visible border and legend that breaks the border line.

data-variant="minimal"

Borderless fieldset for subtle grouping. The legend appears as a heading. (This replaces the former .minimal class.)

Radio Button Groups

Fieldset is essential for grouping radio buttons. Screen readers will announce the legend before each radio option.

Disabled Fieldset

The disabled attribute on a fieldset disables all form controls within it. VB marks the group with muted text and a dashed border. The fieldset itself is not faded: its controls are disabled too and already dim themselves (buttons at half opacity, inputs on the raised surface), so fading the fieldset as well would compound to an unreadable quarter opacity. In forced-colors mode the group uses the system GrayText colour.

Status Variants

Use data-status to apply a subtle border tint indicating the state of the fieldset's contents. Uses the same vocabulary as inline semantics.

Pair the status with words. The tint is colour only, which colour-blind users and screen readers do not get. Say the state in the legend (as the demo does: "Payment Complete", "Validation Errors") or in a message inside the group. In forced-colors mode VB switches to a heavier border whose style differs per state: solid for success, dotted for warning, double for error.

Value Border color Use case
success Green-tinted Validated section, completed step
warning Yellow-tinted Needs attention, incomplete
error Red-tinted Validation errors present

Checkbox Group Validation

On a fieldset of checkboxes, data-min-checked and data-max-checked set how many boxes must be ticked. The form coordinator checks the count, sets data-invalid on the fieldset when it is out of range, and writes the message into the fieldset's direct-child <output>. Override the default messages with data-message-min-checked and data-message-max-checked.

Do not set data-invalid by hand: the coordinator (and form-field styles) provide both the red border and the text message, so the error is never conveyed by colour alone. Keep the <output> in place for that message.

Accessibility Notes

  • Always include a legend: The legend provides the accessible name for the group
  • Legend must be first child: For proper rendering, legend must be the first element inside fieldset
  • Screen reader behavior: The legend is announced before each control in the group
  • Required for radio groups: Radio buttons should always be in a fieldset for accessibility
  • Avoid nesting too deep: Limit nesting to maintain comprehension
  • Status is not colour alone: Pair data-status with legend text or a message; forced-colors mode gets a border-style cue

CSS Reference

Related

  • legend - Caption for the fieldset (required first child)
  • form - Container for fieldsets
  • input - Form controls within fieldsets
  • form-field - Enhanced form field wrapper
  • data-toggle-tags - Checkbox group as selectable chips
  • data-show-when - Show or hide a whole fieldset based on another field
  • data-wizard - Each fieldset becomes a step of a multi-step form
  • data-autosave - Put data-autosave-ignore on a fieldset to keep its fields out of drafts
  • disabled - Disables every control inside a fieldset
  • form - A fieldset's form attribute does not cascade to its controls
↑