Skip to content
Alea0.1

Navigation

SkipLink and VisuallyHidden

The first link on the page jumps past the navigation; hidden text gives screen readers context the screen already shows.

Ant Design: -

import { SkipLink, VisuallyHidden } from '@alea/ui';

Examples

Skip link

Press Tab on this page: the first stop is the skip link (shown here inside the preview).

Props

VisuallyHidden props

Content for screen readers only: still read, never shown (MUI visuallyHidden, Chakra VisuallyHidden).

PropTypeDefaultDescription
childrenrequiredReactNode-Text only screen readers should hear.
as"div" | "h2" | "h3" | "p" | "span"-Render as another element. Default span.

Accessibility

  • SkipLink is hidden until it gets focus, then slides in at the top left. Put it first in the body and give your main element the same id.
  • VisuallyHidden keeps text in the accessibility tree; never use it to hide things sighted keyboard users need.

Keyboard

KeyDoes
Tab (first)Shows the skip link
EnterJumps to the content

Do and don't

Do

  • Put SkipLink first in every page with navigation before the content.
  • Use VisuallyHidden for context like "(opens in a new tab)".

Don't

  • Don't hide focusable controls with VisuallyHidden.
  • Don't point the skip link at an element without the id.
Tested with axe, keyboard and screen reader roles