Skip link examples
-
# default
{ "text": "Skip to main content", "href": "#test-target-element" }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "text": "Skip to main content", "href": "#test-target-element" }) }} -
# with focus
{ "classes": ":focus", "text": "Skip to main content", "href": "#test-target-element" }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "classes": ":focus", "text": "Skip to main content", "href": "#test-target-element" }) }} -
# no href
{ "text": "Skip to main content" }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "text": "Skip to main content" }) }} -
# custom href
{ "text": "Skip to custom content", "href": "#custom" }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "text": "Skip to custom content", "href": "#custom" }) }} -
# custom text
-
# html as text
{ "text": "<p>skip</p>" }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "text": "<p>skip</p>" }) }} -
# html
-
# classes
-
# attributes
{ "text": "Skip link", "attributes": { "data-test": "attribute", "aria-label": "Skip to content" } }{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %} {{ govukSkipLink({ "text": "Skip link", "attributes": { "data-test": "attribute", "aria-label": "Skip to content" } }) }}