Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    VisuallyHidden

    Hides content visually and keeps it available to screen readers.

    Storybook
    Storybook
    Source
    Source
    Package
    @bigbang/ui
    Import
    import { VisuallyHidden } from '@bigbang/ui';

    VisuallyHidden is in the @bigbang/ui package. Installation and style files are the same as for Button; see the Button code tab for details.

    import { VisuallyHidden } from '@bigbang/ui';
    <VisuallyHidden>...</VisuallyHidden>;
    <VisuallyHidden focusable render={<a href="#main" />}>...</VisuallyHidden>;
    childrenRequired
    Description
    Text for screen readers only, such as the context of an icon-only control or a table caption.
    Type
    ReactNode
    focusable
    Description
    Shows the content while it, or a link inside it, has keyboard focus. Use it for skip links.
    Type
    boolean
    Default
    false
    render
    Description
    Renders another element, such as <caption> or <a>. Defaults to a <span>.
    Type
    ReactElement | ComponentRenderFn<HTMLProps, {}>

    Native <span> attributes are passed through. className and style are not accepted.

    • data-component="visually-hidden": on the root element.
    • data-focusable: on the root element when focusable is on (empty value).