Highlight
Draw attention to specific written content, from other content on the page.
Props
Name | Type | Default | Description |
---|---|---|---|
id | other | 'id' attribute to place on the base HTML element | |
classBlock | other | Block name override in BEM style classes applied to all elements | |
classModifiers | other | BEM style modifiers to apply to the base HTML element | |
className | other | Extra classes to apply to the base HTML element |
When to use this component
The highlight can be used to solve different problems:
- in search results to highlight matches and partial matches
- highlight differences or similarities
When to not use this component
Do not:
- only use colour to highlight differences, use other elements such as bold
- use with other coloured components within content
- overuse
How it works
Writing for this component
Consider explaining the purpose of the highlight, especially if there are different use cases within a service. It takes users time to work out what the highlight is showing.
Accessibility
You should:
- combine bold text with the highlight
- use in moderation - overuse reduces efficacy and can cause unecessary mental load, especially for people using screen readers
Research
This component is used by:
- an internal service to compare identity details
The highlight does not work if:
- it's overused
- there are multiple conflicting colours on the screen
We found this from usability testing with 3 external participants with access needs, with varying severities of vision loss. Participants used screen readers and zoom function whilst participating. High level findings include:
- the highlight doesn’t draw the attention of users using screen readers
- bold was more useful to alert participants who were partially sighted
- conflicting colours on screen was disorienting for partially sighted users
Help us improve this component
This component needs improving. We need more evidence about:
- internal staff, who use systems daily
- users with other access needs, such as dyslexia, dyscalculia and ADHD
- new staff members or those recently trained on a service
To contribute, add your thoughts and research findings to our GitHub discussion, or follow our contribute guidance.