The skip links component is a navigation item providing links to key areas of interest on the current page, usually to the main content area and footer information. This component is not visible unless focused, and is intended mainly for screen reader users to bypass repetitive web page content to quickly get to critical information.
This component can contain any number of links, which have an href attribute set to the ID of the HTML element they point to. Each link has a
tabindex attribute set, the first link with
tabindex="1" and all following links incrementing up by
1 from this; This ensures that these links are the first set of focusable elements on the page despite where it is included.
This component is visually hidden. When any of its links become focused, that link will animate into the viewport at the top right of the webpage and become visible. When the link becomes unfocused, it will animate out of the viewport and either the next skip link will be focused and animated in, or the next link within the tab order wil become focused.
This component is automatically included in the page layout and is the first element within the page body. By default, the following links, in order, will be added to the skip links navigation when the page is rendered:
- "Skip to header" - Focuses the header component
- "Skip to main navigation" - Focuses the main navigation component
- "Skip to sub navigation" - Focuses the sub navigation component
- "Skip to main content" - Focuses the main column of content
- "Skip to sidebar" - Focuses the righthand sidebar of content
- "Skip to footer" - Focuses the footer component
When one or more of the above key areas are not found within the page, they will be not be added to the skip links navigation, and the tab order of each link will shift to accommodate this.
The skip links component is not tied to a specific content type. Its styles are included in the Compass T4 page layout CSS, and is used by the page layout to provide skip links on every page.
Skip links provided on every page of a Compass T4 website will only include links to areas of interest if a). the area of interest exists and b). the area of interest contains content. This means the absence of a header component on a page will drop the "Skip to header" link, and a right sidebar void of any content will drop the "Skip to sidebar" link.