ARIA Patterns

5 #Helpers Helpers

Somewhat explicit classes used for enhancing default styles.

Source: kss-styleguide.scss, line 65

5.1 #Helpers.Hidden Hidden

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

The Hidden Helper visually hides an element. Though the element is hidden from visual media, it is kept in the accessibility tree so that assistive technology such as screen readers can still expose it to users. A skip link is a common use case for this pattern.

Note: The [aria-hidden] attribute has the opposite effect: it hides an element from the accessibility tree while keeping it visually exposed. To hide the element from both the accessibility tree and visual media, you can use [class="h-Hidden" aria-hidden="true"], or you can use the [hidden] attribute, which is the preferred approach if the element is not directly relevant.

author
Chris Harvey
updated
Examples
Default styling
:focus
On focus, the element returns to static position.
Markup
<!--link rel="stylesheet" href="/node_modules/aria-patterns/x-hidden/css/dist/h-Hidden.css"/-->
<a class="h-Hidden [modifier class]" href="#0">skip to main content</a>
Source: h-Hidden.less, line 7