Skip to main content

atoms

Nav link

A navigation anchor built from a page entry, marking itself as the current page when its URL matches.

Specimens

Other page
{{ NavLink.render({
  entry: { url: "/work/", key: "Work", description: "Selected projects" },
  currentUrl: "/"
}) }}
Current page A matching currentUrl sets aria-current.
{{ NavLink.render({ entry: { url: "/work/", key: "Work" }, currentUrl: "/work/" }) }}

Params

ParamTypeDescription
entryobjectNavigation entry. Its url or href is the target, pageNavLabel, title or key (first set) is the label, description is the title, and class is a raw class string that replaces classes.
urlstringLink target, used when entry has no URL.
hrefstringAlias for url, used when neither entry nor url is set.
titlestringLabel, used when entry supplies no label.
classesstring, variant map, or arrayApplied through classes. Ignored when entry.class is set.
currentUrlstringWhen it equals the link target, the link gets aria-current="page".
descriptionstringtitle attribute, used when entry has no description.