Skip to content

Visually Hidden

Usage ​

Import VisuallyHidden from its dedicated entry. The default slot is required:

vue
<script setup lang="ts">
import { VisuallyHidden } from '@astryx-vue/core/VisuallyHidden'
</script>

<template>
  <a href="/articles/accessibility">
    Read more
    <VisuallyHidden> about accessibility primitives</VisuallyHidden>
  </a>
</template>

Best practices ​

GuidancePractices
DoUse to give icon-only buttons and controls an accessible name that screen readers announce.
DoRender as a block element (as="div") with aria-live to announce dynamic updates like drag-and-drop or result counts.
Don'tUse it to hide content from everyone; it stays in the accessibility tree; use conditional rendering or hidden to remove content entirely.
Don'tPut interactive controls inside it; the content is not visible and cannot receive pointer input.

Examples ​

Add context and dynamic status information that assistive technology needs but the visual interface does not show.

Supplementary context

Add screen-reader-only context to a short link so its purpose remains clear when read outside the surrounding page.

Live region

Items added: 0

Use a block root and aria-live to announce dynamic visual updates while keeping the hidden content in the accessibility tree.