Display
Visually Hidden
Content that stays out of view but is still announced by assistive technology — a typed wrapper around juxt.ui’s shared sr-only utility.
Installation #
With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:
import { JVisuallyHidden } from '@juxtui/ui'Usage #
<button type="button">
<SearchIcon />
<JVisuallyHidden>Search</JVisuallyHidden>
</button>Always hidden — unlike a "skip link" pattern, it never reappears on focus. For a link that should become visible on keyboard focus, build that separately.
Renders as a <span> by default; use as to render a <label>, a heading or anything else that needs its own semantics while staying visually hidden.
Variants & examples #
As a form label#
Pair a visually hidden <label> with a placeholder-only input, so the field still has a real accessible name.
As a hidden heading#
Gives a landmark region a real heading for screen readers while the sighted design shows only a logo mark.
Company logo
API #
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| as | string | Component | 'span' | Render as another element or component, e.g. label or h2. |
Slots
| Slot | Props | Description |
|---|---|---|
| default | — | The hidden content. |
Accessibility #
- Uses the same clip-based hiding technique as most design systems: present in the accessibility tree and readable by screen readers, but removed from visual layout and pointer interaction.
- Does not affect focusability — if the wrapped content is interactive (e.g. a link), it stays in the tab order.