Skip to main content

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

PropertyTypeDefaultRequiredDescription
asElementType'span'NoSpecifies the rendered HTML tag or a different custom component to be used.
childrenReactNode-YesText content to be rendered within the component. This content is required and should be accessible to screen readers, even if visually hidden.
classNameString-NoAllows extending the class names of the component.