Feedback 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 Feedback 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
titleText string Required. Text to use within the title of the Feedback component. If titleHtml is provided, the titleText option will be ignored.
titleHtml string Required. HTML to use within the title of the Feedback component. If titleHtml is provided, the titleText option will be ignored.
headingLevel integer Heading level, from 1 to 6. Default is 2.
text string Required. Text to use within the Feedback component content. If html is provided, the text option will be ignored.
html string Required. HTML to use within the Feedback component content. If html is provided, the text option will be ignored.
caller nunjucks-block Not strictly a parameter but a Nunjucks code convention. Using a call block lets you call a macro with all the text inside the tag. This is helpful if you want to pass a lot of content into a macro. To use it, you’ll need to wrap the entire Feedback component in a call block.
classes string Classes to add to the Feedback component container.
attributes object HTML attributes (for example, data attributes) to add to the Feedback component container.