Skip to main content
Components

Skip link

Use the skip link component to help keyboard-only users skip to the main content on a page.

As in govuk-frontend, once JavaScript runs it moves focus to the main content, which is outlined until focus moves on.

Read the Design System guidance for skip link

Import

import { SkipLink } from 'govuk-react/skip-link';

Examples

Default

Code
<SkipLink href="#main-content">
  Skip to main content
</SkipLink>

Auto focussed

Code
<>
  <Body>The skip link in this example focuses automatically. This is for visual regression testing.</Body>
  <AutoFocussedSkipLink {...args} />
  <div id="main-content">
    <Body>This content has an id of `main-content` to match the skip link&apos;s `href`.</Body>
  </div>
</>

API reference

Use the skip link component to help keyboard-only users skip to the main content on a page.

As in govuk-frontend, once JavaScript runs it moves focus to the main content, which is outlined until focus moves on.

No props of its own. Other props are passed to the element it renders.