File size: 772 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# ScreenReaderText (JSX)
ScreenReaderText is a component that is invisible on screen, but read out to screen readers. Use this to add context to inputs, buttons, or sections that might be obvious from visual cues but not to a screen reader user.
This idea was pulled from WordPress core, for more background & technical details, see [Hiding text for screen readers with WordPress Core](https://make.wordpress.org/accessibility/2015/02/09/hiding-text-for-screen-readers-with-wordpress-core/)
---
## How to use
```js
import { Button, Gridicon, ScreenReaderText } from '@automattic/components';
function ScreenReaderTextExample() {
return (
<Button>
<Gridicon icon="cross" />
<ScreenReaderText>{ translate( 'Close' ) }</ScreenReaderText>
</Button>
);
}
```
|