Summary expander
A component used to present summarised and tagged user details in an expander box.
Summary
Summary expander combines existing components from the NHS Digital service manual design system including tags, summary list, buttons and expander.
The expander is modified to allow placement of tags which are visible in both open and collapsed states but which are not part of the expander's toggle control.
The intention is to use this component when displaying a search result of multiple account details including admin status and other tags giving the user more than just a name to select by. Buttons can be set to perform any required action on the summary for example managing roles or changing a password.
The key difference is a separate container for summary tags. These remain visible at all times and do not gain a focus state.
Expander padding has been reduced and we recommend use of small buttons by including small: true when calling them.
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.
Macro options
Summary expander properties
expander_title(string, required) - The text displayed on the expander toggle headeris_admin(boolean) - When set totrue, displays a distinct "Admin" tag floated to the right of the expander header, independent of thetagsarraytags(array) - An array of tag objects displayed inside the header tag container. Each object accepts standard NHS.UK Tag macro options (for example,text,colour,classes)buttons(array) - An array of button objects rendered within the expander action area. Each object accepts standard NHS.UK Button macro options (for example,text,href,variant). We recommend settingsmall: truefor actions inside this componentsummary_list(object) - Configuration object passed directly to render the internal definition list. Accepts all standard NHS.UK Summary list macro options (for example,rows,key,value,actions)open(boolean) - Set totrueif the expander should be expanded by default; defaults tofalse