Material-ui: A11y: Material UI tables should have option to provide caption/aria-labelledby for screen reader users

Created on 3 Oct 2019  路  4Comments  路  Source: mui-org/material-ui


Best practice for tables is to provide a caption or aria label for user context when using a screenreader. Screen readers read the caption or name of the table when user navigate to the table, giving users a sense of what the table is about. The caption element is the most straightforward way to give a name to a table, but it is also possible to use aria-label or aria-labelled by.
https://www.w3.org/WAI/tutorials/tables/caption-summary/
https://dequeuniversity.com/checklists/web/tables

In this case, to avoid having to impose a specific style on developers using an MUI table, a useful option would be to provide an optional ariaLabelledBy prop that is applied to the inner <table> tag, such that developers can show or hide a caption visually as necessary.

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Summary 馃挕


Developers should be able to specify a caption for implementations of MUI <Table>.

Examples 馃寛


MUI Table: https://material-ui.com/components/tables/
Example using aria-describedBy
https://www.w3.org/WAI/tutorials/tables/caption-summary/#using-aria-describedby-to-provide-a-table-summary

Motivation 馃敠


This can be particularly important in cases where multiple tables are in use on a screen. On a page with multiple tables, screen reader users can pull up a list of all tables on the web page, which will show the captions along with the table size.

accessibility docs good first issue

Most helpful comment

@eps1lon Can I update the docs for table with aria-label if that's okay.

That'd be nice. Bonus if you add a fully accessible example using a styled description either using caption or aria-describedby.

All 4 comments

Good point. Though this is already possible. I guess we should include this by default in our docs

<Table aria-label="a labelled table">....</Table>
<Table><caption>A captioned table</caption></Table>

Nice one! Thank you

@eps1lon Can I update the docs for table with aria-label if that's okay.

@eps1lon Can I update the docs for table with aria-label if that's okay.

That'd be nice. Bonus if you add a fully accessible example using a styled description either using caption or aria-describedby.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chris-hinds picture chris-hinds  路  3Comments

ghost picture ghost  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

newoga picture newoga  路  3Comments

sys13 picture sys13  路  3Comments