Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Skip Nav

Allows keyboard and screen reader users to skip repeated content and jump straight to the main content of the page.

Recipe
Skip to Content

Navigation

Repeated on every page, so keyboard users want to skip past it.

Main Content

Focus lands here when the skip link is activated.

Anatomy

import { SkipNavContent, SkipNavLink } from '@chakra-ui/react'
<SkipNavLink>Skip to content</SkipNavLink>
<SkipNavContent />

Usage

Per WCAG 2.4.1 (Bypass Blocks — Level A), a page that repeats the same navigation across pages should offer a way to bypass it. A screen reader user can jump between headings or landmarks, but a sighted keyboard user cannot — they have to tab through every navigation link before reaching the content.

The key things to note:

  • SkipNavLink renders an a tag that is visually hidden until it receives keyboard focus. Place it as high in the tree as possible, so it is the first thing a user tabs to.
  • SkipNavContent renders a div that acts as the target. It can be self-closing or wrap your main content.
  • Both components share a default id, so they link up without any configuration.

Examples

Basic

Render SkipNavLink before your navigation and SkipNavContent right before the main content. Tab into the example below to reveal the link.

Skip to Content

Navigation

Repeated on every page, so keyboard users want to skip past it.

Main Content

Focus lands here when the skip link is activated.

Custom ID

Pass a custom id to change the anchor. The value must be set on both components, otherwise the link has nothing to point at.

Skip to Main Content

Header & Navigation

Both components use the same main-content id.

Main Content

The id must match on both sides, otherwise the link does nothing.

Wrapping the content

SkipNavContent can wrap the main content area instead of being self-closing. This makes the whole region the focus target, which reads better in screen readers.

Skip to Content

Site Header

Home

About

Pricing

Contact

Welcome

Wrapping the main content makes the whole region the focus target, so screen readers continue reading from here.

Props

PropDefaultType
id 'chakra-skip-nav'
string

The id of the `SkipNavContent` to link to. Must match the id used on `SkipNavContent`.

children
React.ReactNode

The label of the link, for example "Skip to content".

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.

Content

PropDefaultType
id 'chakra-skip-nav'
string

The id used as the anchor target. Must match the id used on `SkipNavLink`.

children
React.ReactNode

Optional main content to wrap. When omitted the component renders an empty div that acts as the focus target.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.