|
Download wp-calypso/packages/components/src/screen-reader-text/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 772 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/screen-reader-text/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/components/src/screen-reader-text/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/screen-reader-text/README.md
772 Bytes
| # 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> | |
| ); | |
| } | |
| ``` | |