molecules
Nav item
One entry in a navigation list, either a plain link or a native details disclosure when it has children.
Specimens
{{ NavItem.render({ item: { key: "Work", url: "/work/", children: [] } }) }}{{ 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
| Param | Type | Description |
|---|---|---|
item | object | Nav entry: key, url, and optional children. With children it renders a <details> disclosure. |
accordionName | string | Shared 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.