Askr documentation
Generated API snapshot

@askrjs/ui/visually-hidden

Exports from the declarations published in @askrjs/ui. Signatures reflect the published artifact.

Exports

This entrypoint publishes 7 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

VISUALLY_HIDDEN_A11Y_CONTRACTtype

VISUALLY_HIDDEN_A11Y_CONTRACT: { readonly STRATEGY: "visually-hidden-but-screen-reader-visible"; readonly HOST_ELEMENT: "span"; }

Visually hidden content accessibility contract.

VisuallyHiddentype

VisuallyHidden: { (props: VisuallyHiddenSpanProps): JSX.Element; (props: VisuallyHiddenAsChildProps): JSX.Element; }

Renders a part of `visually-hidden`. Supports polymorphic rendering via `asChild`.

VisuallyHiddenA11yContracttype

VisuallyHiddenA11yContract: typeof VISUALLY_HIDDEN_A11Y_CONTRACT

Type of the Visually Hidden A11y Contract object.

VisuallyHiddenAsChildPropstype

VisuallyHiddenAsChildProps: VisuallyHiddenOwnProps & {
  asChild: true;
  children: JSXElement;
  ref?: Ref<Element>;
}

Props for the `asChild` (polymorphic) rendering of Visually Hidden.

asChild
asChild: true;
children
children: JSXElement;
ref
ref?: Ref<Element>;

VisuallyHiddenOwnPropstype

VisuallyHiddenOwnProps: {
  children?: unknown;
}

Own props for Visually Hidden, before merging with native element attributes.

children
children?: unknown;

VisuallyHiddenPropstype

VisuallyHiddenProps: VisuallyHiddenSpanProps | VisuallyHiddenAsChildProps

Props for Visually Hidden.

asChild
asChild?: boolean | undefined;
children
children?: unknown;
ref
ref?: ((value: HTMLSpanElement | null) => void) | { current: HTMLSpanElement | null; } | ((value: Element | null) => void) | { current: Element | null; } | null | undefined;

VisuallyHiddenSpanPropstype

VisuallyHiddenSpanProps: Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> & VisuallyHiddenOwnProps & {
  asChild?: false;
  ref?: Ref<HTMLSpanElement>;
}

Props for Visually Hidden Span.

asChild
asChild?: false | undefined;
children
children?: unknown;
ref
ref?: Ref<HTMLSpanElement>;