VisuallyHidden

VisuallyHidden hides its children visually, while keeping content visible to screen readers.

import {VisuallyHidden} from 'react-aria/VisuallyHidden';

<VisuallyHidden>I am hidden</VisuallyHidden>

API

VisuallyHidden

NameTypeDefault
childrenReactNodeDefault: —

The content to visually hide.

elementTypestring | JSXElementConstructor<any>Default: 'div'

The element type for the container.

isFocusablebooleanDefault: —

Whether the element should become visible on focus, for example skip links.

idstring | undefinedDefault: —

useVisuallyHidden

For additional rendering flexibility, use the useVisuallyHidden hook . It supports the same options as the component, and returns props to spread onto the element that should be hidden.

useVisuallyHidden(props: ):

Example

See useRadioGroup and useCheckbox for examples of using VisuallyHidden to hide native form elements visually.