Skip to content

Table: expose row index / startFrom as a table-level ARIA concern (aria-rowindex) #3939

Closed

Description

@humbertovirtudes

Context

Follow-up from review of #3756 (useTableRowIndex).

startFrom on useTableRowIndex is currently a presentational offset for the visible index column. But the row ordinal is fundamentally an accessibility concern — the ARIA row index (aria-rowindex) should be correct even when no visible index column is rendered.

Proposal

Consider exposing row-index numbering (including a startFrom / offset) as a Table-level prop rather than only via the useTableRowIndex plugin, so:

  • aria-rowindex on <tr> is correct regardless of whether a visible # column is shown.
  • The visible-index plugin can then read/derive from the same source of truth instead of maintaining its own numbering.

Considerations

  • Pagination: the ARIA row index should reflect the row's position in the full dataset, not just the current page — needs to account for page offset.
  • Interaction with sorting/filtering (does the ARIA index follow the rendered order or the source order?).
  • Overlap/relationship with the existing useTableRowIndex plugin — likely the plugin should consume the table-level index rather than duplicate it.

Raised from @cixzhang's review comment on #3756.

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions