Highlight
Draw attention to specific written content, from other content on the page.
12/12/1995
Props
Name | Type | Default | Description |
---|---|---|---|
id | string | 'id' attribute to place on the base HTML element | |
classBlock | string | Block name override in BEM style classes applied to all elements | |
classModifiers | other | BEM style modifiers to apply to the base HTML element | |
className | string | 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
United Kingdon (UK)
PEX 354 857 999
Niles Turnball
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:
- Entity search to highlight search results
- an application process for comparing information in the machine readable zone (MRZ) of passports
We did usability testing with 3 external participants with access needs, with varying levels of blindness. 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.