GOV.UK footer Nunjucks macro options

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

Also see the guidance on the GOV.UK footer component page, which shows these options in use within each example.

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

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.

Primary options
Name Type Description
meta object The meta section of the footer after any navigation, before the copyright and license information. See macro options for meta.
navigation array The navigation section of the footer before a section break and the copyright and license information. See macro options for navigation.
contentLicence object The content licence information within the footer component. If your service provides its information under a different license than OGL, use null to hide both the OGL logo and licence text. Defaults to Open Government Licence (OGL) v3 licence. See macro options for contentLicence.
copyright object The copyright information in the footer component, this defaults to "© Crown copyright". See macro options for copyright.
containerClasses string Classes that can be added to the inner container, useful if you want to make the footer full width.
classes string Classes to add to the footer component container.
attributes object HTML attributes (for example data attributes) to add to the footer component container.
Options for meta object
Name Type Description
visuallyHiddenTitle string Title for a meta item section. Defaults to "Support links".
html string HTML to add to the meta section of the footer, which will appear below any links specified using meta items.
text string Text to add to the meta section of the footer, which will appear below any links specified using meta items. If meta html is specified, this option is ignored.
items array The meta items add content within a unordered list to the meta section of the footer component. These appear above any text or custom html in the meta section. See macro options for meta items.
Options for meta items array objects
Name Type Description
text string Required. List item text in the meta section of the footer.
href string Required. List item link href attribute in the meta section of the footer.
attributes object HTML attributes (for example data attributes) to add to the anchor in the footer meta section.
Options for navigation array objects
Name Type Description
title string Required. Title for a section.
columns integer Amount of columns to display items in navigation section of the footer.
width string Width of each navigation section in the footer. You can pass any Design System grid width here – for example, "one-third", "two-thirds" or "one-half". Defaults to "full".
items array The items within the navigation section of the footer component. See macro options for navigation items.
Options for navigation items array objects
Name Type Description
text string Required. List item text in the navigation section of the footer.
href string Required. List item link href attribute in the navigation section of the footer. Both text and href attributes need to be present to create a link.
attributes object HTML attributes (for example data attributes) to add to the anchor in the footer navigation section.
Options for contentLicence object
Name Type Description
text string If html is set, this is not required. If html is provided, the text option will be ignored. If neither are provided, the text for the Open Government Licence is used.
html string If text is set, this is not required. If html is provided, the text option will be ignored. If neither are provided, the text for the Open Government Licence is used. The content licence is inside a <span> element, so you can only add phrasing content to it.