This component was retired in September 2024 and should not be used in new projects. Use the Quick reference component instead.
!Important:
This guidance is kept for reference by teams who are already using the key details bar. It is not updated or maintained.
When to use this component
This component is retired and should not be used in new projects. Use the Quick reference component instead.
The key details bar displays a small set of information – two or three data items – that users need to check before starting a task or refer to while doing it.
The basic component includes:
Customer name
National Insurance number
An optional status tag
If your research shows that agents need more information, the bar can be extended by adding a lower block to include data such as a case reference, date of birth or postcode.
When not to use this component
The key details bar does not work well as banner to draw attention to important or urgent information.
Do not use the key details bar instead of an H1 heading.
The component’s high contrast means it quickly becomes harder to read as more text is added. Only use the extended version of the component if you have strong evidence of a genuine user need, and consider other solutions if usability is affected.
How it works
The standard key details bar includes two text items and an optional status tag. The text items should have a clear hierarchy: do not use the same style for multiple items.
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.
The key details bar is a static display component and should be the same in all views. Do not use different versions of the component in different parts of your service.
How to use the status tag
If your users need to see the status or progress of a case (for example, To do / In progress / Complete), the key details bar can include a status tag with this information. Do not use more than one tag.
If used, the status tag should appear on every record. Do not use it as a flag to show attributes that only apply to some records: this information should be placed somewhere more noticeable than the key details bar.
Changing the tag colour
The default styling for a status tag is blue text on a white background, but you can use the standard tag colours from the GOV.UK Design System if you prefer. Make sure that any colours you use meet accessibility standards for visibility and contrast, and do not use colour alone to show status.
This example shows a tag styled using govuk-tag--green:
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.
<sectionclass="dwp-key-details-bar"aria-label="Key details"><divclass="dwp-key-details-bar__key-details"><dlclass="dwp-key-details-bar__top-block"><dtclass="govuk-visually-hidden">Name:</dt><ddclass="dwp-key-details-bar__primary">Jane Doe</dd><dtclass="govuk-visually-hidden">National Insurance Number:</dt><ddclass="dwp-key-details-bar__secondary">QQ 12 34 56 X</dd><dtclass="govuk-visually-hidden">Claim status:</dt><ddclass="dwp-key-details-bar__status"><strongclass="govuk-tag dwp-key-details-bar__status--dwp-default">
Completed
</strong></dd></dl><dlclass="dwp-key-details-bar__bottom-block"><dt>Date of birth:</dt><dd>4 June 1972</dd><dt>Case reference:</dt><dd>RM PX 30</dd></dl></div></section>
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.
The key details bar should be placed outside the <main> tag. This will allow a screen reader user to skip past it using the skip link.
You may need your <h1> to reference something from the key details bar so that it still makes sense when a screen reader user skips the bar. This may be required even if your <h1> is visually hidden.
Accessibility
If you include a status tag, take care to check all possible colour combinations for contrast.
This component was initially designed to support agents on phone calls who needed confirmation that they were speaking to the right person, and any research insights have been from agent-facing services. We do not have research for this component on public-facing services.
Contribute
If you have used or researched this component, please let us know what you found so we can make it better for everyone. There is an open discussion on GitHub where you can share anything you think might be useful.