Material-ui: [docs] Set aria-label for checkbox

Created on 22 Nov 2018  路  5Comments  路  Source: mui-org/material-ui

Hi. I wonder how can I set the aria-label for a checkbox. When I set the aria-label for Checkbox tag. It sets the aria-label for the wrapper div. Thank you!

accessibility docs good first issue

Most helpful comment

@wyseguyonline - all yours

All 5 comments

I wonder how can I set the aria-label for a checkbox?

@quyenlt1812 Like this:

      <Checkbox
        inputProps={{
          "aria-label": "Description"
        }}
      />

https://codesandbox.io/s/p56zokqxxq

I'm wondering. Should we ease the usage of this attribute by providing a dedicated property to the Checkbox, Radio, Switch, Input, etc.?

A dedicated property would be nice. But this works too and leads people to know how to pass props to children.

I think that we can add a note on accessibility in the selection controls documentation page featuring the previous code sample: https://www.w3.org/WAI/tutorials/forms/labels/.

@oliviertassinari Has this issue been taken yet?

@wyseguyonline - all yours

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbozan picture rbozan  路  3Comments

mb-copart picture mb-copart  路  3Comments

FranBran picture FranBran  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments

finaiized picture finaiized  路  3Comments