Skip to content

Commit

Permalink
Merge pull request alphagov#1874 from alphagov/update-select
Browse files Browse the repository at this point in the history
Add preselected setting info to select guidance
  • Loading branch information
EoinShaughnessy authored Sep 21, 2021
2 parents 52195d3 + e705b93 commit 4d50328
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/select/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ layout: layout-pane.njk

The select component should only be used as a last resort in public-facing services because research shows that some users find selects very difficult to use.

## How it works
## When not to use this component

The select component allows users to choose an option from a long list. Before using the select component, try asking users questions which will allow you to present them with fewer options.

Asking questions means you’re less likely to need to use the select component, and can consider using a different solution, such as [radios](../radios/).

## How it works

If you use the component for settings, you can make an option pre-selected by default when users first see it.

If you use the component for questions, you should not pre-select any of the options in case it influences users' answers.

There are 2 ways to use the select component. You can use HTML or, if you’re using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://govuk-prototype-kit.herokuapp.com), you can use the Nunjucks macro.

{{ example({group: "components", item: "select", example: "default", html: true, nunjucks: true, open: false, titleSuffix: "second"}) }}
Expand Down

0 comments on commit 4d50328

Please sign in to comment.