Skip to main content

molecules

Nav item

One entry in a navigation list, either a plain link or a native details disclosure when it has children.

Specimens

Plain link
{{ NavItem.render({ item: { key: "Work", url: "/work/", children: [] } }) }}
With children A native details and summary pair, open by default and keyboard operable without scripting.
{{ NavItem.render({
  accordionName: "specimen-nav",
  item: {
    key: "Docs",
    url: "/docs/",
    children: [
      { key: "Design Docs", url: "/docs/design/" },
      { key: "IA Docs Hub", url: "/docs/ia/" }
    ]
  }
}) }}

Params

ParamTypeDescription
itemobjectNav entry: key, url, and optional children. With children it renders a <details> disclosure.
accordionNamestringShared name for the <details> element, so one stays open at a time.

Fixed design: takes no styling params.

Notes

The macro renders only an li. The caller supplies the surrounding list, and a shared accordionName makes sibling disclosures behave as an accordion.