Skip to main content

This is a new service.

Back link

Read more about the back link component on the Gov.UK Design System website

@using GovUkDesignSystemDotNet

@await Html.GovUkBackLink(new BackLinkViewModel
{
    HtmlOrText = new HtmlOrText("Back"),
    Href = "/",
})

Options

Options for BackLinkViewModel
Name Type Description
HtmlOrText HtmlOrText HTML or text to use within the back link component. Defaults to "Back" Instantiate an HtmlOrText class either with a string (for text) or using the @<text></text> syntax for HTML.
Href string Required. The value of the link’s href attribute.
OverrideWithJavascript bool Should we use javascript to intercept the click and replace it with a call to window.location.back()
Classes List<string> Classes to add to the anchor tag.
Attributes Dictionary<string, string> HTML attributes (for example data attributes) to add to the anchor tag.