What is @react-aria/visually-hidden?
@react-aria/visually-hidden is a React component that allows you to hide content visually while keeping it accessible to screen readers. This is useful for providing additional context or instructions to users who rely on assistive technologies without displaying the content on the screen.
What are @react-aria/visually-hidden's main functionalities?
Visually Hidden Text
This feature allows you to hide text visually while keeping it accessible to screen readers. This is useful for adding extra context or instructions for screen reader users.
<VisuallyHidden>This text is hidden visually but accessible to screen readers.</VisuallyHidden>
Visually Hidden Elements
You can also hide entire elements visually while keeping them accessible to screen readers. This can be useful for interactive elements that should not be visible but still need to be accessible.
<VisuallyHidden><button>Click me</button></VisuallyHidden>
Other packages similar to @react-aria/visually-hidden
react-aria-live
react-aria-live is a package that provides a way to announce updates to screen readers using ARIA live regions. It is similar to @react-aria/visually-hidden in that it focuses on accessibility, but it is more about announcing dynamic content changes rather than hiding content.
react-a11y
react-a11y is a package that helps you identify and fix accessibility issues in your React applications. While it does not provide visually hidden components, it complements @react-aria/visually-hidden by ensuring your application is accessible overall.
react-focus-lock
react-focus-lock is a package that traps focus within a specified area, ensuring that users navigating with a keyboard or screen reader do not accidentally leave a modal or other interactive component. It is related to @react-aria/visually-hidden in that it helps manage focus and accessibility.