Repository navigation
feat(core): Table row index as a table-level ARIA concern (#3939) - #4124
Merged
Merged
Conversation
humbertovirtudes
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 21, 2026 06:21
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTable · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Table - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
approved these changes
Jul 21, 2026
Add `rowIndexStart` and `rowCount` props to Table. When set, the table emits `aria-rowindex` on each body `<tr>` and `aria-rowcount` on the `<table>`, so the row ordinal reflects a row's position in the full dataset (correct across pagination) and is exposed to assistive tech even when no visible index column is rendered. - `rowIndexStart` (default 1): ARIA row index of the first rendered body row. For a windowed/paginated view, pass the offset of the first visible row, e.g. `(page - 1) * pageSize + 1`. - `rowCount`: total dataset size for `aria-rowcount`. - Header row keeps native semantics and is not assigned an ARIA row index, so visible `useTableRowIndex` numbering and `aria-rowindex` stay in agreement. - Data-driven mode only; opt-in (tables that set neither prop are unchanged). Closes #3939.
humbertovirtudes
force-pushed
the
feat/table-aria-rowindex
branch
from
July 29, 2026 06:22
47e5827 to
21c18c1
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two opt-in, table-level props to
Table(andBaseTable):rowIndexStart— the 1-based ARIA row index of the first rendered body row.rowCount— the total number of body rows across all pages/windows.Setting either makes the table emit
aria-rowindexon each body<tr>andaria-rowcounton the<table>.Why
Follow-up from the review of #3756.
startFromonuseTableRowIndexis a presentational offset for the visible#column, but the row ordinal is fundamentally an accessibility concern:aria-rowindexshould be correct even when no visible index column is rendered, and it should reflect a row's position in the full dataset — not just the current page.How
aria-rowindexcounts data rows fromrowIndexStart(default1). A paginated/windowed view passes the offset of its first visible row, e.g.(page - 1) * pageSize + 1.aria-rowcountisrowCountwhen known, or-1(ARIA's "unknown count" convention) for a windowed view with an unknown total (e.g. cursor pagination).useTableRowIndexnumbering and gives intuitive "row X of Y" announcements. The header row keeps native table semantics (no ARIA row index).htmlPropbefore thetransformBodyRowplugin pipeline, so plugins compose over it and can still override per row.Scope / behavior change
Opt-in and backward-compatible: tables that set neither prop are byte-for-byte unchanged (no
aria-rowindex/aria-rowcountemitted). This is deliberately the accessibility half of the follow-up; having the visibleuseTableRowIndexplugin consume this table-level index as its single source of truth is tracked separately in #3940.Testing
Table.test.tsx: default (no ARIA attrs), numbering from 1, pagination offset, unknown-count-1, header row exclusion, and plugin override. Full core suite green (123 tests).Core/TableRowIndex:AriaRowIndexNoVisibleColumnandAriaRowIndexWithPagination.build, core + docs + storybook typechecks,lint, copyright / sync-exports / token-docs checks, docsite generate + test.Closes #3939.