VisuallyHidden
Accessible visually hidden content helper.
Preview
A live, theme-aware example rendered with the published component.
Import
Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.
tsximport { VisuallyHidden } from "@tavojs/ui/visually-hidden";Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/visually-hidden.
When to use
Use it when
Choose something else when
Examples
VisuallyHidden example
tsximport { VisuallyHidden } from "@tavojs/ui/visually-hidden";
export function VisuallyHiddenExample1() {
return (
<>
<VisuallyHidden>Loading complete</VisuallyHidden>
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
as | string | Component<Record<string, unknown>> | — | Changes the rendered root element or component while preserving Tavo.js UI styling and public props. |
focusable | boolean | — | Configures focusable for this component. |
Complete TypeScript API
Import from @tavojs/ui/visually-hidden. Published exports: VisuallyHidden, VisuallyHiddenProps.
VisuallyHiddenProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by VisuallyHidden. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by VisuallyHidden. |
id | string | No | Inherited id attribute accepted by VisuallyHidden. |
role | string | No | Inherited role attribute accepted by VisuallyHidden. |
style | Record<string, unknown> | No | Inherited style attribute accepted by VisuallyHidden. |
title | string | No | Inherited title attribute accepted by VisuallyHidden. |
tabIndex | number | No | Inherited tabIndex attribute accepted by VisuallyHidden. |
hidden | boolean | No | Inherited hidden attribute accepted by VisuallyHidden. |
disabled | boolean | No | Inherited disabled attribute accepted by VisuallyHidden. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by VisuallyHidden. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by VisuallyHidden. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by VisuallyHidden. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by VisuallyHidden. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by VisuallyHidden. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by VisuallyHidden. |
as | PolymorphicAs | No | Changes the rendered root element or component while preserving Tavo.js UI styling and public props. |
focusable | boolean | No | Configures focusable for this component. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | No component state contract is exposed; the application owns the rendered content and surrounding behavior. |
| DOM target | The public root follows the as/component prop. Root attributes, className, style, and supported events are forwarded there. |
Anatomy and related components
Limitations
Avoid VisuallyHidden when using feedback components as primary page layout.
Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.
Accessibility
Keeps content available to assistive technology while hiding it visually.
Keeps content available to assistive technology while hiding it visually.
Component status
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | feedback |
| Component import | @tavojs/ui/visually-hidden |
| Explicit CSS import | @tavojs/ui/css/visually-hidden |
| Preview | Interactive preview available on this page |