Skip to content

Details

<details class="asp-details">
  <summary class="asp-details__summary">Details summary</summary>
  <ul>
          <li>Details content (html) with a <a href="#">link</a></li>
        </ul>
</details>
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
summary string Required. The summary text.
content string Required. The details component content. See content.

Options for content

Name Type Description
html string Required. HTML for the details component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the details component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/details/macro.njk" import aspDetails %}

{{ aspDetails({
summary: "Details summary",
content: {
html: '<ul>
<li>Details content (html) with a <a href="#">link</a></li>
</ul>' }
}) }}

Twig 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
summary string Required. The summary text.
content string Required. The details component content. See content.

Options for content

Name Type Description
html string Required. HTML for the details component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the details component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "asp-frontend/components/details/macro.njk" import aspDetails %}

{{ aspDetails({
summary: "Details summary",
content: {
html: '<ul>
<li>Details content (html) with a <a href="#">link</a></li>
</ul>' }
}) }}

Name Type Description
HeaderText string or false (boolean) Required. Text input for the text to be displayed in the header.
BodyHTMLText string or false (boolean) Required. HTML text input for the body of the action component.
Type string or false (boolean) Required. Text input, use either "Blue", "Red", "Amber", or "Grey" to switch between variations. Can be controlled with a variable.
Font string or false (boolean) Required. This is the font that the text will be shown in. This will likely be Font.'Segoe UI'.
Size number Required. Number input for body text size.
DarkMode string or false (boolean) Required. Input to determine if the component should be dark mode or not. Set by named formula variable varDarkMode.
TextBoxHeight string or false (boolean) Required. This is an output property which is then used as the component Height property, for example cmp_ASP_Action.TextBoxHeight.
FlagWidth number Required. Number input to determine the width of the coloured title fill.

Status of development

The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.

Development criteria Status
WCAG 2.2 compliant Not started
WCAG 2.1 compliant Completed
HTML / Nunjucks version Completed
Figma version Not started
M365 versions Completed
Documentation In progress

Published 3 May 2024
Last updated 6 February 2025