Treegrid (Email Inbox)

An inbox table exposes nested conversation rows with level, sibling position, and expansion metadata. The rows-first interaction also allows moving into individual cells and native links.

Corresponding W3C APG example

Example

Rows are focused first. Right expands a thread, then moves into its cells. Left returns to the row and collapses it.

SubjectSummarySender
Re: Exhibition plansObjects for the first roomJordan
Re: Workshop ideasA hands-on sessionLee
Visitor feedbackNotes from the weekendRobin

Keyboard interaction

Up/Down move among visible rows or cells. Right expands a focused row, then enters its cells. Left returns from the first cell to its row, collapses an expanded row, or moves to its parent. Home/End move to row or cell boundaries; Control+Home/End go to the first/last visible row.

Events

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

  • axxy-treegrid-toggle — Dispatched when a treegrid row expands or collapses. (target: Row (<tr> / [role="row"]), detail: { row: HTMLElement, expanded: boolean })

Events reference and examples

Example HTML

<axxy-scope>
  <p id="inbox-help">Rows are focused first. Right expands a thread, then moves into its cells. Left returns to the row and collapses it.</p>
  <table role="treegrid" aria-label="Museum inbox" aria-describedby="inbox-help">
    <thead>
      <tr>
        <th scope="col">Subject</th>
        <th scope="col">Summary</th>
        <th scope="col">Sender</th>
      </tr>
    </thead>
    <tbody>
      <tr id="thread-one" aria-level="1" aria-expanded="false">
        <th scope="row">
          <button type="button">Expand thread</button>
          Exhibition plans
        </th>
        <td>Planning our next exhibition</td>
        <td>
          <a href="mailto:alex@example.com">Alex</a>
        </td>
      </tr>
      <tr id="reply-one" aria-level="2">
        <th scope="row">Re: Exhibition plans</th>
        <td>Objects for the first room</td>
        <td>
          <a href="mailto:jordan@example.com">Jordan</a>
        </td>
      </tr>
      <tr id="reply-two" aria-level="2" aria-expanded="false">
        <th scope="row">
          <button type="button">Expand thread</button>
          Re: Exhibition plans
        </th>
        <td>Workshop ideas</td>
        <td>
          <a href="mailto:sam@example.com">Sam</a>
        </td>
      </tr>
      <tr id="reply-three" aria-level="3">
        <th scope="row">Re: Workshop ideas</th>
        <td>A hands-on session</td>
        <td>
          <a href="mailto:lee@example.com">Lee</a>
        </td>
      </tr>
      <tr id="thread-two" aria-level="1">
        <th scope="row">Visitor feedback</th>
        <td>Notes from the weekend</td>
        <td>
          <a href="mailto:robin@example.com">Robin</a>
        </td>
      </tr>
    </tbody>
  </table>
</axxy-scope>