Skip to content
v0.2.10

VisuallyHidden

Nonvisual content with optional reveal when keyboard focus enters.

Preview

Supporting text remains available to assistive technology.

Changes save automatically.

Use VisuallyHidden

VisuallyHidden is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
visually-hidden.tsxTSX
"use client";

import { FloodRoot, Text, VisuallyHidden } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Text>Project updated.</Text><VisuallyHidden>Changes save automatically.</VisuallyHidden>
    </FloodRoot>
  );
}

Design notes

  • Content remains in the accessibility tree. Default is for noninteractive text only.
  • Use focusable for a skip link or another focusable descendant: the wrapper becomes visible while it contains focus. Supply visible focus styling on the actual control.
  • This is not aria-hidden, display:none or a conditional unmount. as accepts span/div.
  • Available in 0.2.4; use matching installed declarations.

API reference

PropValuesDefault
as"span" | "div""span"
focusablebooleanfalse
Native HTML propsHTMLAttributes<HTMLElement>Forwarded
View TypeScript source