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…
The boolean state attribute of details and dialog: whether a disclosure is expanded or a dialog is showing. Covers exclusive accordions, modal versus non-modal dialogs, closedby, and VB's open and close animation.
Overview
open is a boolean attribute that reflects whether something is showing. On <details> it means the content below the <summary> is expanded; the browser adds and removes it as the user toggles. On <dialog> it means the dialog is shown; the browser sets it when you open the dialog, and you should open and close dialogs with their methods or commands, not by editing the attribute.
<detailsopen><summary>System requirements</summary><ul><li>64-bit processor</li><li>4 GB of memory</li><li>2 GB of free disk space</li></ul></details><detailsname="billing-faq"open><summary>When am I charged?</summary><p>On the first day of each billing period, in your account's currency.</p></details><detailsname="billing-faq"><summary>Can I get a refund?</summary><p>Yes, within 14 days of a charge. Contact support with your invoice number.</p></details>
Values
Element
Present
Absent (default)
<details>
Expanded: the content is shown.
Collapsed: only the summary shows.
<dialog>
Shown. In markup, or from show(), it is non-modal; only showModal() or command="show-modal" makes it modal.
Not shown.
As a boolean attribute, any value (even open="false") means open. The open property reflects it.
Dialog: ways to open
How
Modal
Top layer and backdrop
Rest of page inert
Escape closes
open in markup, or show()
No
No
No
No (unless closedby allows it)
showModal() or command="show-modal"
Yes
Yes
Yes
Yes
Dialog: closedby
closedby
Closes on
any
Light dismiss (a click outside), Escape or other close requests, and script or close commands.
closerequest
Escape or other close requests, and script. The default for modal dialogs.
none
Only script or a close command. The default for non-modal dialogs.
Examples
Modal and non-modal dialogs
The modal opens from an invoker command and closes on a backdrop click (closedby="any"). There is no command for a non-modal dialog, so that button calls show() from a module script.
Both elements fire toggle when open changes, by the user or by script. It fires after the change and can't be cancelled, so read the open property in the handler.
A bordered, rounded box. Adjacent <details> join into one group, except inside gap-based layouts.
The <summary> marker is replaced by a chevron (summary::after) that points to the inline end when closed and down when [open], mirrored in right-to-left text.
Opening and closing animate. ::details-content transitions block-size from 0 to auto, which needs interpolate-size: allow-keywords (set on :root in src/tokens/motion.css). Only Chromium supports interpolate-size; other browsers open and close instantly.
In print, every <details> prints expanded (src/utils/print.css).
Dialog (src/native-elements/dialog/styles.css)
dialog[open] lays out as a flex column: header and footer keep their size and the body scrolls. A closed dialog keeps the browser's display: none.
Opening and closing fade and scale, with @starting-style and discrete display / overlay transitions. ::backdrop uses --color-backdrop and a --backdrop-blur blur, fading in step.
data-size and data-position give size variants and drawers; see the <dialog> page. Dialogs are hidden in print.
<summary> is announced as an expandable control with its expanded or collapsed state. It is focusable and works with Enter and Space; don't add roles or aria-expanded to it.
In supporting browsers (see Browser support), find-in-page searches closed <details> and opens the one that matches, so collapsed content stays findable.
Use a modal dialog (showModal() or command="show-modal") for anything that must be dealt with first. It moves focus in, makes the rest of the page inert, and returns focus to the opener on close. A dialog opened with the openattribute does none of that.
Name every dialog with aria-labelledby pointing at its heading.
Browser support
open on <details> and <dialog>: supported in all current browsers.
name for exclusive <details> groups: Baseline 2024 (Chrome 120, Firefox 130, Safari 17.2).
closedby: Chrome 134, Firefox 141; not yet in a released Safari (as of November 2026).
Gotchas
Don't remove open to close a dialog. The spec advises against it: removing the attribute bypasses the dialog's proper close steps (such as the return value and focus handling). Call close() or requestClose(), or use a close / request-close command.
open in markup makes a non-modal dialog: not in the top layer, without a backdrop, and with the page still usable around it. That is rarely what you want for a dialog that should demand attention.
toggle can't stop the change. It fires after the state has changed.
An exclusive group needs the same name and works only between <details> elements in the same document or shadow root. If the markup has several open in one group, the browser closes all but the first.