Actions

Overflow command disclosure

<forma-overflow-command-disclosure>

Moves secondary commands into explicit native disclosure without shrinking targets or hiding group meaning.

Authoring tag
<forma-overflow-command-disclosure>
Category
Actions
Behavior owner
Native HTML
Canonical source
patterns/overflow-command-disclosure.html

Purpose

An overflow command disclosure is a native details element whose summary (normally "More commands" or a more specific phrase) reveals a labelled group of secondary buttons. The browser owns open and closed state, keyboard toggling and the expanded announcement. The revealed panel is in normal document flow, so it pushes content down rather than floating over it, and the commands keep full 44px targets. Deciding which commands are secondary is an application decision; the disclosure never removes a command, it only defers it.

Use when

  • A toolbar or record header has more commands than fit comfortably, and some are clearly used less often.
  • Secondary commands must remain reachable on phones without shrinking targets or scrolling a toolbar sideways.
  • You want disclosure that works with no script and keeps the revealed commands in the page flow.

Avoid when

  • The hidden commands are critical to the task: keep them visible in a Command group or Mobile action bar.
  • The commands should float over content and close on outside click or Escape: use a Popover-backed Action menu.
  • The hidden content is explanatory text or form fields rather than commands: use Disclosure.

Behavior to know

  • Native details/summary: Enter or Space on the summary toggles it, and the expanded state is announced by the platform.
  • The summary is a 44px-tall flex row. Because it is no longer display: list-item, Chromium and Firefox draw no disclosure marker, so the summary text must say what it reveals.
  • The revealed panel is a wrapping flex row with a role="group" label, reusing the command-group spacing.
  • Opening is instant; nothing animates.

Basic example

The smallest correct markup: the canonical pattern from patterns/overflow-command-disclosure.html inside its public tag. Copy this first, then adapt labels, names and state.

Canonical

Minimal overflow command disclosure

Rendered from the canonical pattern file.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

More commands
HTML · Minimal overflow command disclosure Raw HTML for HTML · Minimal overflow command disclosure
<forma-overflow-command-disclosure class="forma-component-tag">
<details class="forma-overflow-commands">
  <summary>More commands</summary>
  <div class="forma-overflow-commands__panel" role="group" aria-label="More commands">
    <button type="button">Duplicate</button><button type="button">Archive</button>
  </div>
</details>
</forma-overflow-command-disclosure>

Click or tap the code once to select all of it, then copy.

Examples

Scenario

Record toolbar with overflow

The common case: the frequent commands stay visible in a Command group, and three secondary commands sit behind a disclosure at the end of the same row. The panel label repeats the summary text so the revealed buttons are announced as one group.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Customer record

More record commands
HTML · Record toolbar with overflow Raw HTML for HTML · Record toolbar with overflow
<forma-overflow-command-disclosure class="forma-component-tag">
  <section class="forma-command-group" aria-labelledby="overflow-command-disclosure-record-toolbar-overflow-label">
    <h2 class="forma-command-group__label" id="overflow-command-disclosure-record-toolbar-overflow-label">Customer record</h2>
    <div class="forma-command-group__commands">
      <button type="button">Edit</button>
      <button type="button">Send message</button>
      <details class="forma-overflow-commands">
        <summary>More record commands</summary>
        <div class="forma-overflow-commands__panel" role="group" aria-label="More record commands">
          <button type="button">Merge duplicates</button>
          <button type="button">Export history</button>
          <button type="button">Archive customer</button>
        </div>
      </details>
    </div>
  </section>
</forma-overflow-command-disclosure>

Click or tap the code once to select all of it, then copy.

Scenario

Open on arrival with many commands

The open attribute renders the disclosure expanded on first load, for example when the application restores the user's last choice. Six commands with long labels wrap inside the panel. After load the browser owns the state; the attribute reflects it.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Bulk commands for 24 selected items
HTML · Open on arrival with many commands Raw HTML for HTML · Open on arrival with many commands
<forma-overflow-command-disclosure class="forma-component-tag">
  <details class="forma-overflow-commands" open>
    <summary>Bulk commands for 24 selected items</summary>
    <div class="forma-overflow-commands__panel" role="group" aria-label="Bulk commands for 24 selected items">
      <button type="button">Assign to a teammate</button>
      <button type="button">Change priority</button>
      <button type="button">Add labels</button>
      <button type="button">Move to another project</button>
      <button type="button">Export as CSV</button>
      <button type="button">Close selected items</button>
    </div>
  </details>
</forma-overflow-command-disclosure>

Click or tap the code once to select all of it, then copy.

Mobile

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.

Mobile example

Overflow on a phone

At phone width the disclosure keeps secondary commands out of the way until requested. Once open, the panel wraps its commands onto new lines below the summary and pushes the following content down.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Viewport width

Frames narrower than the selected width show the component at the width available.

What changes at narrow widths

  • The summary row is at least 44px tall and spans the available width, so it is an easy tap target.
  • Revealed commands wrap in source order; none are shrunk or scrolled sideways.
  • The panel is in normal flow, so opening it moves following content down rather than covering it; there is no viewport clipping to manage.
  • There are no breakpoints. If the same commands are visible on desktop, the application decides whether to render them inline or in the disclosure; Forma does not move them.
HTML · Overflow on a phone Raw HTML for HTML · Overflow on a phone
<forma-overflow-command-disclosure class="forma-component-tag">
  <div class="forma-stack">
    <div class="forma-actions">
      <button type="button">Approve</button>
      <button type="button">Request changes</button>
    </div>
    <details class="forma-overflow-commands">
      <summary>More review commands</summary>
      <div class="forma-overflow-commands__panel" role="group" aria-label="More review commands">
        <button type="button">Reassign reviewer</button>
        <button type="button">Copy review link</button>
        <button type="button">Mark as spam</button>
      </div>
    </details>
  </div>
</forma-overflow-command-disclosure>

Click or tap the code once to select all of it, then copy.

Baseline

Mobile · 320px

The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.

Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.

Viewport width

Frames narrower than the selected width show the component at the width available.

API and configuration

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.

Native and ARIA attributes
AttributeOnValuesDefaultDescription
opendetailsbooleanabsent (closed)Initial expanded state. The browser toggles it as the user opens and closes the disclosure.
role.forma-overflow-commands__panelgroup—Exposes the revealed commands as one named group.
aria-label.forma-overflow-commands__panelstring—Names the group; normally the same text as the summary so the context is repeated when focus enters the commands.
typebuttonbutton—Commands are ordinary buttons that must not submit an enclosing form.
CSS hooks (derived from dist/all.css)
HookKindValues or defaultDescription
.forma-overflow-commandsBlock class—Root details element. Positioned relative so application enhancements can anchor to it.
.forma-overflow-commands__panelElement class—The revealed wrapping row of commands, with a top gap under the summary. Uses --forma-command-space from an enclosing Command group when present.
Keyboard interaction
KeysResult
Tab / Shift+TabMoves to the summary, then into the revealed commands when open.
Enter / SpaceOn the summary, toggles the disclosure (native details behavior). On a command, activates it.
Events
EventDescription
toggleNative event fired on the details element after it opens or closes.
clickNative click on each command button.

Form behavior

Does not participate in forms. The commands inside are type="button".

States

Overflow command disclosure states
StateHow it is expressedPresentation
Closedno open attributeOnly the summary is visible. There is no visual open/closed marker; the platform announces the collapsed state.
Openopen attribute / details[open]The panel of commands appears below the summary in normal flow. The appearance of the commands is the only visual cue.
Focus:focus-visible on summaryThe shared two-tone focus ring on the summary.

Accessibility

Forma provides

  • Uses native details/summary, so the summary is a focusable disclosure button whose expanded state is announced.
  • Gives the summary a 44px minimum height and keeps the commands at full button size.
  • Does not rely on color for state; note that no visual expanded/collapsed marker is drawn, so the revealed commands are the visual cue.

Your application supplies

  • Write a specific summary label ("More record commands") rather than an icon or ellipsis alone.
  • Label the panel with role="group" and aria-label matching the summary.
  • Never put the only path to a critical or frequently needed command in the overflow.
  • Decide per application which commands are secondary; keep that choice stable across records.

Responsive behavior

  • The panel is a wrapping flex row; commands wrap in source order and never overflow horizontally.
  • The revealed panel is in document flow, so it cannot be clipped by the viewport the way a floating menu can.
  • No breakpoints are defined; moving commands between the visible row and the overflow at different widths is application markup, not CSS.
  • Long summary text wraps within the summary line.

Motion

  • No animation: the panel appears and disappears instantly with the native open state. There is nothing for reduced motion to remove.

Usage guidance

Do

  • Keep the two or three most common commands visible and move the rest into the overflow.
  • Match the panel's aria-label to the summary text.

Avoid

  • Labelling the summary with only "…" or an icon.
  • Using the overflow to hide destructive commands so they seem less important; they still need clear labels and application confirmation.
  • Placing an overflow disclosure inside another overflow disclosure.

Verification specimens

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.