Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hakuna-matata-ui/visually-hidden

monacohq12MIT1.1.2TypeScript support: included

A React component that visually hides its content

react, component, chakra, chakra ui, a11y, aria, accessibility, accessible, visually hidden, visually hidden component, sr-only, screenreader

readme

@hakuna-matata-ui/visually-hidden

The visually hidden component styles itself so that it’s content is not visible, but it is available to assistive technologies like screen readers and other text to speech programs.

Installation

yarn add @hakuna-matata-ui/visually-hidden

# or

npm i @hakuna-matata-ui/visually-hidden

Import component

import { VisuallyHidden } from "@hakuna-matata-ui/visually-hidden"

Basic usage

// it renders a `span` by default
<VisuallyHidden>This content will be hidden on screen</VisuallyHidden>

// for visually hidden input fields
<VisuallyHiddenInput type="checkbox" defaultChecked/>

References