VisuallyHidden@astryxdesign/core v0.7.5 · VisuallyHidden

Usage

Renders content in the accessibility tree while hiding it visually. Use for accessible names on icon-only controls, aria-live announcement regions, and supplementary screen-reader context. Deliberately has no styling props; the whole point is to stay invisible. xstyle is still accepted and ignored, only so code written against 0.7.2 keeps compiling; a planned minor removes it.

ts
import {VisuallyHidden} from '@astryxdesign/core/VisuallyHidden'

Best practices

GuidancePractices
Do

Use to give icon-only buttons and controls an accessible name that screen readers announce.

Do

Render as a block element (as="div") with aria-live to announce dynamic updates like drag-and-drop or result counts.

Don't

Use it to hide content from everyone; it stays in the accessibility tree; use conditional rendering or hidden to remove content entirely.

Don't

Put interactive controls inside it; the content is not visible and cannot receive pointer input.

Props

PropTypeDescription
children
ReactNode

Content exposed to assistive technology while hidden from sight.

as
ElementType (default: 'span')

HTML tag to render as. Use a block element for live regions.

Examples

Common configurations, variations, and states.
VisuallyHidden — Live Region
Open in Playground

A polite aria-live region announces visual-only state changes to assistive technology.

VisuallyHidden — Structural Heading
Open in Playground

Give a visually implicit section an accessible name so screen-reader users can navigate to it.

VisuallyHidden — Supplementary Context
Open in Playground

Stat cards whose trend arrows get screen-reader-only text, so a change like +12% is read as an increase from last month. Use to make terse visual data accessible.

Use with shadcn

Already using the shadcn registry workflow? Install the real Astryx package and a local public re-export. Component implementation source stays in Astryx.

This install URL expires with the draft preview.
bash
npx shadcn@4.19.0 add https://astryx-fqbvpjk8h-fbopensource.vercel.app/shadcn/components/visually-hidden.json