Skip to main content
All components

ComponentSkip link

3 of 3 upstream examples match. Razor component: <NhsukSkipLink>

Hide the 2 test-only examples

Default

Razor Pages and MVC
<nhsuk-skip-link href="#maincontent" text="Skip to main content" />
Blazor
<NhsukSkipLink Href="#maincontent" Text="Skip to main content" />
Nunjucks (upstream)
{% from "nhsuk/components/skip-link/macro.njk" import skipLink %}

{{ skipLink({
  "href": "#maincontent",
  "text": "Skip to main content"
}) }}

Without hash fragment

Razor Pages and MVC
<nhsuk-skip-link
    href="/nhsuk-frontend/components/boilerplate/"
    text="Skip to main content"
/>
Blazor
<NhsukSkipLink
    Href="/nhsuk-frontend/components/boilerplate/"
    Text="Skip to main content"
/>
Nunjucks (upstream)
{% from "nhsuk/components/skip-link/macro.njk" import skipLink %}

{{ skipLink({
  "href": "/nhsuk-frontend/components/boilerplate/",
  "text": "Skip to main content"
}) }}

Without link target

Razor Pages and MVC
<nhsuk-skip-link href="#this-element-does-not-exist" text="Skip to main content" />
Blazor
<NhsukSkipLink Href="#this-element-does-not-exist" Text="Skip to main content" />
Nunjucks (upstream)
{% from "nhsuk/components/skip-link/macro.njk" import skipLink %}

{{ skipLink({
  "href": "#this-element-does-not-exist",
  "text": "Skip to main content"
}) }}