What is the difference between accessibilityLabel and aria-label properties of view component in react native? React native documentation is not enough to understand. Examples would be more appreciated.
Short answer is they are the same thing but accessibilityLabel
is used for native mobile apps and aria-label
is used for web/HTML apps.
They both will override the accessible name of an element.
You typically only need to override the label if the contents of that element doesn't provide enough context or detail.
For example, if you have a button that contains an image but no text (eg, a print icon), then that button will need a "print" label. If you're creating a native app, you'd set the accessibilityLabel
attribute. If you're creating a website, you'd set the aria-label
attribute.