Disclosure

5 Disclosure variations from the W3C ARIA Authoring Practices Guide.

Disclosure (Card)

An expandable card keeps its heading, link, and concise disclosure button separate. Clicking noninteractive summary text toggles details; links, form controls, text selection, and expanded content keep their own behavior.

Corresponding W3C APG example

Example

Designing for everyone

A practical workshop with Alex Morgan.

Thursday, 10:00–11:30 · Studio 2

Practice accessible forms, labels, and keyboard navigation in a small group.

Alex Morgan leads the museum’s design workshops.

Keyboard interaction

Tab to the disclosure button. Enter or Space shows or hides its content; focus stays on the button.

Events

Listen on the widget or delegate to <axxy-scope> or document. All custom events bubble.

  • axxy-disclosure-change — Dispatched when a disclosure panel expands or collapses. (target: Trigger <button>, detail: { expanded: boolean, panel: HTMLElement })

Events reference and examples

Example HTML

<axxy-scope>
  <article aria-roledescription="disclosure card">
    <h3 id="card-title">Designing for everyone</h3>
    <p>
      A practical workshop with
      <a href="#speaker">Alex Morgan</a>
      .
    </p>
    <p>Thursday, 10:00–11:30 · Studio 2</p>
    <button id="card-button" aria-labelledby="card-title card-button">Details</button>
    <div>
      <p>Practice accessible forms, labels, and keyboard navigation in a small group.</p>
      <label>
        <input type="checkbox">
        Send me the workshop notes
      </label>
    </div>
  </article>
  <p id="speaker">Alex Morgan leads the museum’s design workshops.</p>
</axxy-scope>

Disclosure (FAQ)

Independent questions reveal their answers. Several answers may remain expanded at once.

Corresponding W3C APG example

Example

  • Walk-in visits are welcome. Workshops require a reservation.

  • All exhibition floors have lift access.

  • Tuesday to Sunday, 10:00–18:00.

Keyboard interaction

Tab to the disclosure button. Enter or Space shows or hides its content; focus stays on the button.

Events

Listen on the widget or delegate to <axxy-scope> or document. All custom events bubble.

  • axxy-disclosure-change — Dispatched when a disclosure panel expands or collapses. (target: Trigger <button>, detail: { expanded: boolean, panel: HTMLElement })

Events reference and examples

Example HTML

<axxy-scope>
  <ul>
    <li>
      <button aria-expanded="false">Do I need to book?</button>
      <div>
        <p>Walk-in visits are welcome. Workshops require a reservation.</p>
      </div>
    </li>
    <li>
      <button aria-expanded="false">Is step-free access available?</button>
      <div>
        <p>All exhibition floors have lift access.</p>
      </div>
    </li>
    <li>
      <button aria-expanded="false">When is the museum open?</button>
      <div>
        <p>Tuesday to Sunday, 10:00–18:00.</p>
      </div>
    </li>
  </ul>
</axxy-scope>

Disclosure (Image Description)

A short image description is always available. A disclosure reveals the chart’s exact values in a native data table.

Corresponding W3C APG example

Example

Museum visits by monthVisits increased from January to March. Exact figures are available in the data table.JanFebMar
Museum visits, first quarter
Monthly museum visits
MonthVisits
January400
February700
March1,000

Keyboard interaction

Tab to the disclosure button. Enter or Space shows or hides its content; focus stays on the button.

Events

Listen on the widget or delegate to <axxy-scope> or document. All custom events bubble.

  • axxy-disclosure-change — Dispatched when a disclosure panel expands or collapses. (target: Trigger <button>, detail: { expanded: boolean, panel: HTMLElement })

Events reference and examples

Example HTML

<axxy-scope>
  <figure>
    <svg viewBox="0 0 320 160" width="320" role="img" aria-labelledby="chart-title chart-description">
      <title id="chart-title">Museum visits by month</title>
      <desc id="chart-description">Visits increased from January to March. Exact figures are available in the data table.</desc>
      <path d="M45 15V130H305" fill="none" stroke="currentColor"/>
      <rect x="65" y="90" width="45" height="40" fill="#005a9c"/>
      <rect x="145" y="60" width="45" height="70" fill="#005a9c"/>
      <rect x="225" y="30" width="45" height="100" fill="#005a9c"/>
      <text x="67" y="150">Jan</text>
      <text x="147" y="150">Feb</text>
      <text x="227" y="150">Mar</text>
    </svg>
    <figcaption>Museum visits, first quarter</figcaption>
  </figure>
  <button aria-expanded="false">Show data table</button>
  <div>
    <table>
      <caption>Monthly museum visits</caption>
      <thead>
        <tr>
          <th scope="col">Month</th>
          <th scope="col">Visits</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">January</th>
          <td>400</td>
        </tr>
        <tr>
          <th scope="row">February</th>
          <td>700</td>
        </tr>
        <tr>
          <th scope="row">March</th>
          <td>1,000</td>
        </tr>
      </tbody>
    </table>
  </div>
</axxy-scope>

Disclosure (Navigation Menu)

A museum navigation bar with disclosure buttons and ordinary nested links. Only one dropdown is open at a time; this is site navigation, with native list semantics.

Corresponding W3C APG example

Example

Museum guide

Explore

Collections. Discover the museum at your own pace.

Exhibitions. Discover the museum at your own pace.

Visit

Opening times. Discover the museum at your own pace.

Directions. Discover the museum at your own pace.

Learn

Workshops. Discover the museum at your own pace.

Resources. Discover the museum at your own pace.

Keyboard interaction

Tab and Shift+Tab visit visible buttons and links. Enter or Space toggles a disclosure. Escape closes it and returns focus to its button. Arrow keys, Home and End supplement Tab in this example. Moving focus or clicking outside closes the dropdown.

Events

Listen on the widget or delegate to <axxy-scope> or document. All custom events bubble.

  • axxy-disclosure-change — Dispatched when a disclosure panel expands or collapses. (target: Trigger <button>, detail: { expanded: boolean, panel: HTMLElement })

Events reference and examples

Example HTML

<axxy-scope>
  <nav aria-label="Museum">
    <ul class="disclosure-navigation">
      <li>
        <button >Explore</button>
        <ul>
          <li>
            <a href="#destination-0-0">Collections</a>
          </li>
          <li>
            <a href="#destination-0-1">Exhibitions</a>
          </li>
        </ul>
      </li>
      <li>
        <button >Visit</button>
        <ul>
          <li>
            <a href="#destination-1-0">Opening times</a>
          </li>
          <li>
            <a href="#destination-1-1">Directions</a>
          </li>
        </ul>
      </li>
      <li>
        <button >Learn</button>
        <ul>
          <li>
            <a href="#destination-2-0">Workshops</a>
          </li>
          <li>
            <a href="#destination-2-1">Resources</a>
          </li>
        </ul>
      </li>
    </ul>
  </nav>
  <section aria-labelledby="museum-content">
    <h3 id="museum-content">Museum guide</h3>
    <h4 id="destination-0">Explore</h4>
    <p id="destination-0-0">
      <strong>Collections.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-0-1">
      <strong>Exhibitions.</strong>
      Discover the museum at your own pace.
    </p>
    <h4 id="destination-1">Visit</h4>
    <p id="destination-1-0">
      <strong>Opening times.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-1-1">
      <strong>Directions.</strong>
      Discover the museum at your own pace.
    </p>
    <h4 id="destination-2">Learn</h4>
    <p id="destination-2-0">
      <strong>Workshops.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-2-1">
      <strong>Resources.</strong>
      Discover the museum at your own pace.
    </p>
  </section>
</axxy-scope>

Disclosure (Navigation with Links)

Each section has both a normal destination link and a separate button for related pages. Opening a dropdown does not change the link’s native navigation behavior.

Corresponding W3C APG example

Example

Museum guide

Explore

Collections. Discover the museum at your own pace.

Exhibitions. Discover the museum at your own pace.

Visit

Opening times. Discover the museum at your own pace.

Directions. Discover the museum at your own pace.

Learn

Workshops. Discover the museum at your own pace.

Resources. Discover the museum at your own pace.

Keyboard interaction

Tab and Shift+Tab visit visible buttons and links. Enter or Space toggles a disclosure. Escape closes it and returns focus to its button. Arrow keys, Home and End supplement Tab in this example. Moving focus or clicking outside closes the dropdown.

Events

Listen on the widget or delegate to <axxy-scope> or document. All custom events bubble.

  • axxy-disclosure-change — Dispatched when a disclosure panel expands or collapses. (target: Trigger <button>, detail: { expanded: boolean, panel: HTMLElement })

Events reference and examples

Example HTML

<axxy-scope>
  <nav aria-label="Museum">
    <ul class="disclosure-navigation">
      <li>
        <a href="#destination-0">Explore</a>
        <button aria-label="More explore pages">More</button>
        <ul>
          <li>
            <a href="#destination-0-0">Collections</a>
          </li>
          <li>
            <a href="#destination-0-1">Exhibitions</a>
          </li>
        </ul>
      </li>
      <li>
        <a href="#destination-1">Visit</a>
        <button aria-label="More visit pages">More</button>
        <ul>
          <li>
            <a href="#destination-1-0">Opening times</a>
          </li>
          <li>
            <a href="#destination-1-1">Directions</a>
          </li>
        </ul>
      </li>
      <li>
        <a href="#destination-2">Learn</a>
        <button aria-label="More learn pages">More</button>
        <ul>
          <li>
            <a href="#destination-2-0">Workshops</a>
          </li>
          <li>
            <a href="#destination-2-1">Resources</a>
          </li>
        </ul>
      </li>
    </ul>
  </nav>
  <section aria-labelledby="museum-content">
    <h3 id="museum-content">Museum guide</h3>
    <h4 id="destination-0">Explore</h4>
    <p id="destination-0-0">
      <strong>Collections.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-0-1">
      <strong>Exhibitions.</strong>
      Discover the museum at your own pace.
    </p>
    <h4 id="destination-1">Visit</h4>
    <p id="destination-1-0">
      <strong>Opening times.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-1-1">
      <strong>Directions.</strong>
      Discover the museum at your own pace.
    </p>
    <h4 id="destination-2">Learn</h4>
    <p id="destination-2-0">
      <strong>Workshops.</strong>
      Discover the museum at your own pace.
    </p>
    <p id="destination-2-1">
      <strong>Resources.</strong>
      Discover the museum at your own pace.
    </p>
  </section>
</axxy-scope>