Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

VisuallyHidden

Visible controls with additional screen-reader context.

Preview

Live preview

Changes apply to this preview only.

Accessible compact controls

Page 1
Search the documentation

The search input is named by visually hidden text.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Labels

Icon-only controls keep a real accessible name without adding visible text.

Open preview

Focusable skip link

Tab into the page: the link is clipped, then becomes a fixed panel at the top-left while focused.

Open preview

Live regions

A polite status can stay hidden; screen readers announce it when the text changes.

Open preview

Usage

Use visually hidden text for necessary names, not to conceal essential instructions from sighted users.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluVisuallyHiddenProps

Type source
PimoluVisuallyHiddenProps public API
NameTypeDefaultDescription
asElementType | undefined`span`Element rendered by the wrapper. Defaults to `span`.
focusableboolean | undefinedfalseReveal the content when it receives focus and make it a tab stop. Use it for skip links; leave it off for labels that only assistive technology should read.
hrefstring | undefined—Link target for the skip-link use case (`as="a"`). Layout primitives keep native attribute types narrow because `as` is not generic.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
as

ElementType | undefined

Default: `span`

Element rendered by the wrapper. Defaults to `span`.

focusable

boolean | undefined

Default: false

Reveal the content when it receives focus and make it a tab stop. Use it for skip links; leave it off for labels that only assistive technology should read.

href

string | undefined

No default extracted.

Link target for the skip-link use case (`as="a"`). Layout primitives keep native attribute types narrow because `as` is not generic.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Confirm hidden text contributes to the accessible name without becoming a duplicate announcement.
Read the accessibility guide →