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 "details/macro.njk" import aspDetails %}

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

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 Not started
Documentation In progress

Published 3 May 2024
Last updated 13 September 2024