Skip to main content
Standard component

Nunjucks macro options

Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.

Some options are required for the macro to work; these are marked as "Required" in the option description.

If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.

Name Type Description
items array Required. Array of object navigation items, see items
selectedItem string URL string to highlight selected navigation item
selectedSubItem string URL string to highlight selected navigation sub item
ariaLabel string Aria label for navigation, defaults to 'Side Navigation'
mobile object Object of options to control mobile navigation, see mobile

Options for items array object

Name Type Description
text string Required. Value for text of the naivigation link
href string Required. Value for the href of the navigation link
id string Value for the id of the navigation link
subItems array Array of object navigation items, see items subItems

Options for items subItems array object

Name Type Description
text string Required. Value for text of the sub naivigation link
href string Required. Value for the href of the sub navigation link
id string Value for the id of the sub navigation link

Options for mobile object

Name Type Description
disabled boolean toggled if mobile navigation is disabled
showButtonText string Set the initail value of the toggle button, default is "Show navigation"
hideButtonText string Value of the toggle button, default is "Hide navigation"