Live demo
Demo source
Use a select to choose one value from a short, predefined list, such as a country or a delivery method. It uses the browser's native list, so it is quick and familiar but cannot show icons or rich content. To search a long list or show custom options, use a dropdown.
Anatomy
A select with four callouts: 1 marks the label Field label, 2 the field showing the prompt Input example, 3 the description below it, and 4 the chevron at the right end of the field.
- Label (optional) names the choice.
- Field shows the selected option, or a prompt such as "Choose a country" from an option with an empty value.
- Description (optional) adds guidance.
- Chevron opens the native list.
List variants
Pass options as an options array, or place option and optgroup elements
inside the select. Groups keep longer lists scannable. clearable adds a
button that empties the selection. A flat list suits a few simple choices;
use groups when choices belong to named categories.
The design illustrates richer list variants, but the implemented field
uses native select and option elements. Rich option rendering varies by
browser and operating system; use a dropdown when icons, tags or tooltips
are essential to choosing correctly.
States
Hover and focus styles are built in. required marks the label with an
asterisk. A disabled select cannot be used, and a read-only select shows the
selected label as text. Set error with an errorDescription that says what
to choose, or success to confirm a valid choice.
Error feedback
A required select in its error state. Callouts mark 1 the required label, 2 the outlined input, 3 the error description and 4 the warning icon.
- Required label adds an asterisk when a choice is mandatory.
- Input outline turns red when
erroris set. - Error description explains what the user needs to correct.
- Warning icon reinforces the invalid state without relying on colour alone.
Themes
The design includes Spark and Ocean appearances. Use the page's theme and mode controls to compare the live examples; retain the same labels, states and validation messages in each theme.
Guidelines
- Keep lists short; group options when a list grows past about 10 to 15.
- Order options logically, such as alphabetically or by frequency.
- Use a clear prompt rather than preselecting a value people might miss.