Screenreader: React
Screenreader is a utility component that visually hides content to provide an accessible experience for users of assistive technology.
Installation
Before you can start using the @mediahuis/chameleon-react
component, you’ll need to install it, for more information check: Getting started for developers.
With that done, you’re now ready to implement the component in your application.
import { Screenreader } from '@mediahuis/chameleon-react';
export default function Example() {
return <Screenreader>Example</Screenreader>;
}
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
as | ElementType | 'span' | No | Specifies the rendered HTML tag or a different custom component to be used. |
children | ReactNode | - | Yes | Text content to be rendered within the component. This content is required and should be accessible to screen readers, even if visually hidden. |
className | String | - | No | Allows extending the class names of the component. |