Skip to content

Table ​

catnip-table, catnip-table-row, and catnip-table-cell expose table, row, cell, and column header roles, and sortable headers set aria-sort. You provide the table's name, the sort state, and accessible names for interactive content in cells.

Screen readers ​

PartSemantics
Table (catnip-table)role="table", named by tableAriaLabel.
Row (catnip-table-row)role="row".
Cell (catnip-table-cell)role="cell", or role="columnheader" when header is set.
Sortable headeraria-sort from activeSort (ascending / descending / none).
Interactive content in cellsCheckboxes, links, and buttons keep their own accessible names.

What you own ​

  • Table name: Set tableAriaLabel (HTML: table-aria-label) to the visible title text, or to a concise name when there is no visible title, including when a matching visible heading sits outside the component. The element with role="table" is inside CatnipTable's shadow root, so external heading IDs cannot be resolved by ariaLabelledby across the shadow boundary.

    html
    <h2>Events</h2>
    <catnip-table table-aria-label="Events">
      <!-- rows -->
    </catnip-table>
  • Sort state: Sortable headers only reflect activeSort; you still own sort state and data order.

  • Cell content: Give interactive content in cells its own accessible name, for example checkboxAriaLabel on a row checkbox (see Selection).

Catnip Design System by Signicat