Visually Hidden

Visually hidden wrapper that keeps content available to screen readers while hiding it on screen via sr-only. Use it for icon button labels and extra context.

src/registry/ui/visually-hidden.tsx/r/visually-hidden.json

Installation#

bash
npx shadcn@latest add @minidev/visually-hidden

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/visually-hidden.json

Usage#

tsx
import { VisuallyHidden } from "@/components/ui/visually-hidden"

export function Example() {
  return <VisuallyHidden />
}

API reference#

VisuallyHidden props
PropTypeDefault
children*React.ReactNode-
classNamestring-

* required

All layout components

Learn more