Skip to content

Find what you need, instantly

Search components, ARIA roles & attributes, and WCAG criteria.

Disclosure

Disclosure (Show/Hide)

A single button that shows or hides a section of content, without accordion grouping semantics.

Last verified against WCAG 2.2 and WAI-ARIA APG 1.2 on 2026-07-02.

Implementation

disclosure-pattern.tsx
function DisclosurePattern() {
  const [expanded, setExpanded] = useState(false);
  const panelId = "disclosure-pattern-panel";

  return (
    <div>
      <button
        aria-expanded={expanded}
        aria-controls={panelId}
        onClick={() => setExpanded(e => !e)}
      >
        Advanced options
      </button>
      <div id={panelId} hidden={!expanded}>
        {/* panel content */}
      </div>
    </div>
  );
}

Live demo

Required roles, states & properties

Required roles, states, and properties
ElementAttributeWhy
Trigger <button>aria-expandedCommunicates whether the panel is currently visible — announced as "expanded" or "collapsed." Must update synchronously with every toggle.
Trigger <button>aria-controlsAssociates the trigger with the panel id it toggles, so AT can relate the two even though they aren't nested.
Panelhidden attributeRemoves the panel and everything inside it from the accessibility tree and the tab order while collapsed — stronger than a CSS-only visual hide.

Keyboard interaction model

Keyboard interaction model
KeyBehavior
Tab / Shift+TabMoves focus to and from the trigger button; panel content is only reachable via Tab when the panel is expanded.
Enter / SpaceToggles the panel open or closed.

Focus management rules

  • Panel content is only in the Tab order while expanded — collapsed content is never reachable.
  • Toggling the panel never moves focus away from the trigger.
  • There is no arrow-key model — a disclosure is a single control, not a group like Accordion.

WCAG 2.2 success criteria mapping

WCAG 2.2 success criteria that apply to this component
SCNameLevelWhy it applies
2.1.1KeyboardAAll functionality is operable through a keyboard interface with no specific timing.
4.1.2Name, Role, ValueAFor all UI components, name, role, and value are programmatically determinable; states and changes are announced.

References