Skip to main content
All components

ComponentBack link

7 of 7 upstream examples match. Razor component: <NhsukBackLink>

Default

Razor Pages and MVC
<nhsuk-back-link text="Back" href="#" />
Blazor
<NhsukBackLink Text="Back" Href="#" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "text": "Back",
  "href": "#"
}) }}

Default

Razor Pages and MVC
<nhsuk-back-link text="Back" href="#" variant="reverse" />
Blazor
<NhsukBackLink Text="Back" Href="#" Variant="reverse" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "text": "Back",
  "href": "#",
  "variant": "reverse"
}) }}

With HTML

Razor Pages and MVC
<nhsuk-back-link html="What to expect at A&amp;E" />
Blazor
<NhsukBackLink Html="What to expect at A&amp;E" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "html": "What to expect at A&amp;E"
}) }}

With HTML via call block

Razor Pages and MVC
<nhsuk-back-link>
    What to expect at A&amp;E
</nhsuk-back-link>
Blazor
<NhsukBackLink>
    What to expect at A&amp;E
</NhsukBackLink>
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{% call backLink({}) %}
  What to expect at A&amp;E
{% endcall %}

With text escaping

Razor Pages and MVC
<nhsuk-back-link text="What to expect at A&E" />
Blazor
<NhsukBackLink Text="What to expect at A&E" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "text": "What to expect at A&E"
}) }}

As a button

Razor Pages and MVC
<nhsuk-back-link text="Back" type="submit" />
Blazor
<NhsukBackLink Text="Back" Type="submit" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "text": "Back",
  "type": "submit"
}) }}

As a button

Razor Pages and MVC
<nhsuk-back-link text="Back" type="submit" variant="reverse" />
Blazor
<NhsukBackLink Text="Back" Type="submit" Variant="reverse" />
Nunjucks (upstream)
{% from "nhsuk/components/back-link/macro.njk" import backLink %}

{{ backLink({
  "text": "Back",
  "type": "submit",
  "variant": "reverse"
}) }}