Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified

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


How to use

import { Button, Gridicon, ScreenReaderText } from '@automattic/components';

function ScreenReaderTextExample() {
    return (
        <Button>
            <Gridicon icon="cross" />
            <ScreenReaderText>{ translate( 'Close' ) }</ScreenReaderText>
        </Button>
    );
}