Menu
Components
This page is In Progress and subject to frequent changes
Please contact Ken Pickering to verify any information is correct before using it.
Dropdown
In Progress
Hey, this is an old version. View the latest
Dropdowns allow users to make a single selection from a list of options. They’re widely used across our question sets.
UX Owner: Benjamin Puckering
UI Owner: Steven Roberts
Note: This component doesn't yet exist in Storybook, preliminary image(s) shown.
On this page
Example
When to use
Dropdowns can be used where:
- You’re asking the user to select only a single option from a pre-defined list
- There are more than 6 options
- Selection options are no more than a few words in length (see the section below about writing selection option text)
When not to use
Text inputs shouldn’t be used where:
- Where there are so many selection options that the list becomes impractical to scroll through, consider using a lookup instead (provided users have a good chance of being able to guess what items might be in the list).
- Where there are fewer than 6 selection options, consider using a radio button group instead
Anatomy
Dropdown layout
Dropdowns almost always span 100% of the width available.
However, the width can also be set to a specific value where the selection option text is so short that it leaves an awkwardly large amount of white space (like when we’re asking a user to pick from a list of numbers).
Dropdown list
We don’t use custom styling for the list of items displayed in our drop-down list; we allow the list to be displayed in line with the browser’s default styling and functionality.
Examples
This is largely a technical decision; it avoids the ongoing maintenance and complexity of ensuring our dropdown list displays correctly across each of the most common browsers and devices.
But it’s also good for our users too. Using a common UI component for the dropdown list means our users are already familiar with how the field works.
Input states
Empty
The empty state is used where no text has yet been entered into the input (either by the user or through any form of pre-fill).
Using placeholder text
Use placeholder text only where it supports users in providing a valid input. Generally, this should be in the form of an example input.
Complete
The complete state is used wherever the field is not empty i.e. text has been entered into the input (either by the user or through any form of pre-fill).
The user input text is bolder and darker than the placeholder text used for the empty state, but the other style properties remain unchanged.
Interaction states
For general information and guidance about these states, see interaction states.
Hover
There is no hover style for text inputs. The cursor changes to the text select, which provides sufficient indication that the input is interactive.
Focus
When focus is applied to a text input an offset border is applied and the caret (text indicator) is displayed.
Disabled
When disabled, there are no hover or focus interactions and the text input can’t be interacted with. Both empty and complete inputs can be disabled. In both cases, the style is change to give the appearance of a 50% opacity.
Validation states
Error
Where text inputs are invalid, they use the same error state, irrespective of whether the validation is triggered due to an empty field or the field containing an invalid data format.
The border element is the only part of the field to change – the text style does not change.
As soon as a text input with the error validation state is focussed, the error state is removed.
Similar components
There are a range of components that either resemble (or are based on) the text input component.
Where to find this component
Documentation version history
Last updated Wednesday, 30th June 2021 13:22 by Gemma D.
Changes In This Version
| Changed Field(s) |
|---|
| Content |
Change History
| Change | Date | User |
|---|---|---|
| Version 34 | Wednesday, 30th June 2021 13:22 | Gemma D. |
| Version 33 | Wednesday, 30th June 2021 13:21 | Gemma D. |
| Version 32 | Tuesday, 29th June 2021 22:09 | Gemma D. |
| Version 31 | Monday, 21st June 2021 10:12 | Gemma D. |
| Version 30 | Monday, 21st June 2021 10:10 | Gemma D. |
| Version 29 | Monday, 29th March 2021 21:38 | Gemma D. |
| Version 28 | Monday, 29th March 2021 21:38 | Gemma D. |
| Version 27 | Monday, 29th March 2021 21:02 | Gemma D. |
| Version 26 | Monday, 29th March 2021 21:02 | Gemma D. |
| Version 25 | Monday, 29th March 2021 13:01 | Gemma D. |
| Version 24 | Monday, 29th March 2021 11:45 | Gemma D. |
| Version 23 | Friday, 26th March 2021 14:10 | Adrian T. |
| Version 22 | Friday, 26th March 2021 00:06 | Ken Pickering |
| Version 21 | Thursday, 25th March 2021 23:43 | Ken Pickering |
| Version 20 | Thursday, 25th March 2021 23:43 | Ken Pickering |
| Version 19 | Thursday, 25th March 2021 23:41 | Ken Pickering |
| Version 18 | Thursday, 25th March 2021 23:31 | Ken Pickering |
| Version 17 | Thursday, 25th March 2021 23:27 | Ken Pickering |
| Version 16 | Thursday, 25th March 2021 23:26 | Ken Pickering |
| Version 15 | Thursday, 25th March 2021 23:25 | Ken Pickering |
| Version 14 | Thursday, 25th March 2021 23:23 | Ken Pickering |
| Version 13 | Thursday, 25th March 2021 23:21 | Ken Pickering |
| Version 12 | Thursday, 25th March 2021 23:20 | Ken Pickering |
| Version 11 | Thursday, 25th March 2021 23:08 | Ken Pickering |
| Version 10 | Thursday, 25th March 2021 23:08 | Ken Pickering |
| Version 9 | Thursday, 25th March 2021 23:07 | Ken Pickering |
| Version 8 | Thursday, 25th March 2021 23:07 | Ken Pickering |
| Version 7 | Thursday, 25th March 2021 23:06 | Ken Pickering |
| Version 6 | Thursday, 25th March 2021 23:04 | Ken Pickering |
| Version 5 | Thursday, 25th March 2021 23:03 | Ken Pickering |
| Version 4 | Thursday, 25th March 2021 22:38 | Ken Pickering |
| Version 3 | Monday, 15th March 2021 22:32 | Gemma D. |
| Version 2 | Thursday, 11th March 2021 11:09 | Gemma D. |
| Version 1 | Tuesday, 2nd February 2021 17:40 | Gemma D. |