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

hidden

Mark content as not relevant right now so it is not rendered, focusable or announced, or use hidden='until-found' to collapse it while find-in-page can still reveal it.

Overview

The hidden attribute says an element is not relevant to the page's current state. The browser doesn't render it, so it can't be seen, focused or clicked, screen readers don't announce it, and find-in-page doesn't search it. Show it again by removing the attribute.

The until-found value is a softer hide: the content is collapsed, but find-in-page and fragment links can still match it, and the browser reveals it when they do.

Applies to: any HTML element (it is a global attribute).

Values

ValueState
hidden, hidden="" or hidden="hidden"Hidden: not rendered (display: none).
hidden="until-found"Hidden until found: rendered with content-visibility: hidden, so it takes no space and its content is skipped, but find-in-page can match it.
Any other valueHidden (the invalid-value default).
Attribute absentShown.

Keywords are case-insensitive. The attribute isn't inherited, but nothing inside a hidden element is rendered either. In script, el.hidden returns true, false or the string "until-found", and accepts the same.

Compared with inert

AttributeVisibleUsableAccessibility treeFind-in-page
hiddenNoNoNoNo
hidden="until-found"NoNoNo, until revealedYes, and reveals it
inertYes, unstyledNoNoSkipped in Chrome and Firefox; found in Safari
(none)YesYesYesYes

Examples

Searchable collapsed content

Search the demo for "passkey". The browser fires beforematch on the hidden element, removes hidden, and scrolls to the match. Use the event to update anything that tracks the open state, such as a button label.

A closed <details> already does this for its content: find-in-page opens it. Don't nest a hidden="until-found" element inside one; use until-found for collapsed regions that aren't <details>, such as tab panels or "read more" sections. See open.

From script

In Vanilla Breeze

[hidden] always wins

The browser hides elements with a plain display: none, which any author rule that sets display overrides: a section { display: block }, a layout's display: grid, a theme. VB's reset makes the attribute authoritative:

It sits in the reset layer, the lowest one. An !important declaration in an earlier layer beats !important declarations in later layers and every normal declaration, so no VB component, layout, utility, theme or unlayered author rule can show a hidden element by accident. To show it, remove the attribute. until-found is left out so the browser's own content-visibility rule can do its work.

VB's other visibility gates

Two VB attributes use the same mechanism and are imported into the reset layer by src/main.css:

Features that set hidden

Accessibility

  • Hidden content is removed from the accessibility tree, so screen readers don't announce it. Use hidden only when nobody should get the content.
  • To hide text visually but keep it for screen readers, use the .visually-hidden utility instead.
  • aria-labelledby and aria-describedby can still point at a hidden element: its text is used for the name or description.
  • hidden="until-found" content is not in the accessibility tree until it is revealed, so screen reader users can't reach it by reading or by their screen reader's own search. Give them a visible control that reveals it as well.
  • Hiding the element that has focus drops focus to the document. Move focus first, for example to the button that hid it.

Browser support

  • hidden: supported in every browser.
  • hidden="until-found": Chrome 102, Firefox 148, Safari 26.2. Safari doesn't yet scroll to the match correctly, and Firefox 139–147 had the same problem (as of November 2026). Browsers without support don't reveal the content on search.
  • beforematch event: Chrome 102, Firefox 139, Safari 26.2.

Gotchas

  • Outside VB, CSS can undo hidden. Any display rule beats the browser's default. VB's reset prevents that; in your own projects add the same rule.
  • until-found needs a box. It works through content-visibility, which doesn't apply to inline elements or to display: contents. Use a block element such as <section> or <p>.
  • Revealing removes the attribute. After a match the element is plainly shown. Re-collapse it yourself if your UI expects that.
  • data-toggle="hidden" on an until-found element turns it into plain hidden on the second click, because it toggles presence. Set el.hidden = 'until-found' from script instead.
  • Hidden form controls are still submitted and validated (except type="hidden" inputs, which are never validated). A hidden required field blocks submit; disable it too, as data-show-when does.

Related

  • inert — keep content visible but unusable.
  • open — <details>, which is searchable when closed.
  • popover — content that is hidden until a button opens it.
  • <details> — the native disclosure widget.

Which to choose

  • hidden — content that isn't relevant right now, for everyone.
  • hidden="until-found" — long collapsed content people may search for.
  • <details> — a disclosure with its own button, searchable when closed.
  • inert — visible for context but not usable.
  • .visually-hidden — for screen readers only.
  • data-visible — one version for small screens and another for large.
  • hide-until-ready — avoid a flash of an un-upgraded component.
  • data-show-when — form sections that depend on other answers.
↑