Skip to main content
Components

Select

Help users select an item from a list.

Read the Design System guidance for select

Import

import { Select, SelectField } from 'govuk-react/select';

Examples

Default

Code
<SelectField
  id="sort"
  name="sort"
  label="Sort by"
>
  {options}
</SelectField>

Select with hint text

Code
<SelectField
  id="sort"
  name="sort"
  label="Sort by"
  hint="This can be different to where you went before"
>
  {options}
</SelectField>

Select with hint text error

Code
<SelectField
  id="sort"
  name="sort"
  label="Sort by"
  hint="This can be different to where you went before"
  errorMessage="Select a location"
>
  {options}
</SelectField>

API reference

Select

Help users select an item from a list.

PropType
errorboolean
widthFluidWidth

SelectField

Help users select an item from a list.

PropType
labelSize"s" | "m" | "l" | "xl"
labelIsPageHeadingboolean
widthFluidWidth
label

The label used by the select component.

ReactNode
hint

Can be used to add a hint to the select component.

ReactNode
errorMessage

Can be used to add an error message to the select component. The error message component will not display if you use a falsy value for errorMessage, for example false or null.

ReactNode