Breadcrumbs
Read more about the
breadcrumbs
component on the Gov.UK Design System website
@using GovUkDesignSystemDotNet
@await Html.GovUkBreadcrumbs(new BreadcrumbsViewModel
{
Crumbs = new List<CrumbViewModel>
{
new CrumbViewModel
{
HtmlOrText = new HtmlOrText("Home"),
Href = "/"
},
new CrumbViewModel
{
HtmlOrText = new HtmlOrText("Components"),
Href = "/components"
},
new CrumbViewModel
{
HtmlOrText = new HtmlOrText("Breadcrumbs"),
},
}
})
Options
Options for BreadcrumbsViewModel
|
List<CrumbViewModel>
|
Required.
The items within the breadcrumbs.
See options for CrumbViewModel
|
|
List<string>
|
Classes to add to the breadcrumbs container.
|
|
bool
|
When true, the breadcrumbs will collapse to the
first and last item only on tablet breakpoint and below.
|
|
Dictionary<string, string>
|
HTML attributes (for example data attributes) to add to the breadcrumbs container.
|
|
string
|
Plain text label identifying the landmark to screen readers. Defaults to “Breadcrumb”.
|
Options for CrumbViewModel
|
HtmlOrText
|
Required.
HTML or text to use within the breadcrumbs item.
Instantiate an HtmlOrText class either with a string (for text) or using the
@<text></text>
syntax for HTML.
|
|
string
|
Link for the breadcrumbs item.
If not specified, breadcrumbs item is a normal list item.
|
|
Dictionary<string, string>
|
HTML attributes (for example data attributes) to add to the individual crumb.
|