Advanced options
Additional controls or explanatory content go here.
<forma-disclosure>
Expandable content built on details and summary with no runtime behavior layer; where interpolate-size is supported the panel settles to its intrinsic height, otherwise it opens instantly.
<forma-disclosure>patterns/disclosure.htmlA disclosure hides optional content behind a labelled row that the user opens when needed: advanced options, explanations, secondary detail. It is a native details element with class="forma-disclosure", a summary, and an forma-disclosure__content wrapper. The browser owns the open state (open attribute), keyboard toggling, the expanded announcement, find-in-page auto-expansion, and exclusive accordions via the name attribute. Forma draws top and bottom rules, a 44px summary row with a "+" indicator that turns to "×" when open, and light entry motion. Content inside stays in normal flow and pushes the page down.
The smallest correct markup: the canonical pattern from patterns/disclosure.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
Live demo. 1 native action works here and is verified by an outcome test.
Additional controls or explanatory content go here.
<forma-disclosure class="forma-component-tag">
<details class="forma-disclosure" data-forma-motion-weight="light">
<summary>Advanced options</summary>
<div class="forma-disclosure__content">
<p>Additional controls or explanatory content go here.</p>
</div>
</details>
</forma-disclosure>
Click or tap the code once to select all of it, then copy.
Three adjacent disclosures sharing name="disclosure-exclusive-faq", so opening one closes the others (a native exclusive accordion in supporting browsers; elsewhere they open independently). Adjacent rules collapse into single dividers.
Live demo. 3 native actions work here and are verified by an outcome test.
Yes. Upgrades apply immediately; downgrades apply at the start of the next billing period.
Your workspace becomes read-only for 30 days so you can export it. After that it is deleted.
Registered non-profits receive 40% off any paid plan. Contact support with your registration number.
<forma-disclosure class="forma-component-tag">
<div>
<details class="forma-disclosure" name="disclosure-exclusive-faq" open>
<summary>Can I change my plan later?</summary>
<div class="forma-disclosure__content">
<p>Yes. Upgrades apply immediately; downgrades apply at the start of the next billing period.</p>
</div>
</details>
<details class="forma-disclosure" name="disclosure-exclusive-faq">
<summary>What happens to my data if I cancel?</summary>
<div class="forma-disclosure__content">
<p>Your workspace becomes read-only for 30 days so you can export it. After that it is deleted.</p>
</div>
</details>
<details class="forma-disclosure" name="disclosure-exclusive-faq">
<summary>Do you offer discounts for non-profits?</summary>
<div class="forma-disclosure__content">
<p>Registered non-profits receive 40% off any paid plan. Contact support with your registration number.</p>
</div>
</details>
</div>
</forma-disclosure>
Click or tap the code once to select all of it, then copy.
A disclosure that starts open because the user changed one of its fields last time. It contains form fields, which submit whether the disclosure is open or closed. The standard motion weight gives the larger panel a slightly slower settle.
Live demo. 1 native action works here and is verified by an outcome test.
How many times to retry a failed webhook before giving up.
<forma-disclosure class="forma-component-tag">
<details class="forma-disclosure" data-forma-motion-weight="standard" open>
<summary>Advanced delivery settings</summary>
<div class="forma-disclosure__content forma-stack">
<div class="forma-field">
<label class="forma-field__label" for="disclosure-advanced-fields-open-retries">Retry attempts</label>
<p class="forma-field__description" id="disclosure-advanced-fields-open-retries-help">How many times to retry a failed webhook before giving up.</p>
<input id="disclosure-advanced-fields-open-retries" name="retries" type="number" min="0" max="10" value="3" aria-describedby="disclosure-advanced-fields-open-retries-help">
</div>
<div class="forma-field">
<label class="forma-field__label" for="disclosure-advanced-fields-open-timeout">Timeout in seconds</label>
<input id="disclosure-advanced-fields-open-timeout" name="timeout" type="number" min="1" max="60" value="10">
</div>
</div>
</details>
</forma-disclosure>
Click or tap the code once to select all of it, then copy.
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
A disclosure with a long, translated summary at phone width. The summary text wraps beside the indicator, and the row stays a single tap target.
Live demo. 1 native action works here and is verified by an outcome test.
<forma-disclosure class="forma-component-tag">
<details class="forma-disclosure" lang="fr">
<summary>Pourquoi certaines transactions apparaissent-elles deux fois sur mon relevé mensuel ?</summary>
<div class="forma-disclosure__content">
<p>Une préautorisation peut apparaître avant le débit définitif. Elle disparaît généralement sous trois jours ouvrés.</p>
</div>
</details>
</forma-disclosure>
Click or tap the code once to select all of it, then copy.
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Live demo. 1 native action works here and is verified by an outcome test.
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
| Attribute | On | Values | Default | Description |
|---|---|---|---|---|
open | details | boolean | absent (closed) | Initial open state. The browser adds and removes it as the user toggles. |
name | details | string | absent | Groups disclosures into an exclusive accordion: opening one closes the others with the same name. Supported in current browsers; elsewhere each opens independently. |
data-forma-motion-weight | details | light | standard | heavy | light | Presentation-only perceived mass for the indicator and content settle. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-disclosure | Block class | — | The details element: top and bottom functional rules; a following .forma-disclosure drops its top rule so stacks share dividers. Its summary becomes a 44px flex row with the native marker removed and a + / × indicator. |
.forma-disclosure__content | Element class | — | Wrapper for the revealed content, with bottom padding and the entry fade and settle. |
[data-forma-motion-weight] | Attribute hook | "heavy", "light", "standard" | Presentation-only perceived mass: light (default for disclosures), standard or heavy. |
[open] | Attribute hook | — | Native open state. [open] rotates the indicator 45° (+ becomes ×) and, where supported, lets ::details-content settle to its intrinsic height. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves focus to the summary, then into the open content. |
| Enter / Space | Toggles the disclosure (native summary behavior). |
| Event | Description |
|---|---|
toggle | Native event fired on the details element after it opens or closes. |
Fields inside a closed disclosure still belong to their form and are submitted. Invalid fields inside a closed disclosure can block submission out of sight; keep required fields outside or open the disclosure on error.
| State | How it is expressed | Presentation |
|---|---|---|
| Closed | no open attribute | Only the summary row is shown, with a + indicator. |
| Open | details[open] | Content visible below the summary; indicator rotated to ×. |
| Pressed | :active on summary | The indicator scales down slightly while pressed; the row does not move. |
| Focus | :focus-visible on summary | Shared two-tone focus ring on the summary. |
summary.@starting-style.interpolate-size and ::details-content are supported, the content region animates its block size from 0 to its intrinsic height with the inertial duration; elsewhere it opens instantly. The native open state is always immediate.data-forma-motion-weight changes perceived mass (light by default).prefers-reduced-motion: reduce the height transition is removed entirely (so content is never delayed), and the indicator and content transitions become effectively instant.Forma motion is physics-derived: perceived mass changes how a surface accelerates and settles, never what state it is in. Compare the three presentation weights of the same markup:
Additional controls or explanatory content go here.
Additional controls or explanatory content go here.
Additional controls or explanatory content go here.
name for exclusive accordions only when comparing sections side by side is not useful.open attribute is the only state.Generated fault-injection specimens expose content, spacing, color-cue, and reduced-effective-contrast risks. They screen presentation robustness as engineering screens without claiming human-subject validation.