Live demo
Demo source
Use a dropdown in a form to choose one option from a list of related options. For several choices, use a multiselect.
Anatomy
A dropdown field with four callouts: 1 marks the label Field label, 2 the field showing Choose one option, 3 the description below it, and 4 the chevron at the right end of the field.
- Label (optional) says what to choose.
- Field shows the placeholder until an option is chosen, then its label.
It fills its container up to 480 px; set
fluidfor wider layouts. - Description (optional) adds guidance below the field.
- Chevron button opens and closes the list.
List variants and composition
A simple list has short labels. A complex list adds meaningful supporting content, such as an icon, an avatar or a description.
List nv-fielddropdownitem elements in the content slot, or pass options.
Items can hold rich content such as an avatar and supporting text, and a
plain <hr> separates groups. A detached item runs an action, such as adding
an entry, without becoming the value.
Set filterable to let people narrow a long list as they type. For data from a
server, set controlledFilter and supply the matching options yourself. The
filtering guide compares the matching modes.
Size
Use size="sm" for a 32 px field or size="md" for the default 40 px field.
The field is capped at 480 px; fluid lets it fill a wider container.
States and keyboard use
Default, hover and focus styles follow interaction. disabled prevents
selection; readonly preserves the value without editing. Set error with
errorDescription to show the invalid border, icon and corrective message.
From the field, Arrow Down opens the list and moves through options; Arrow Up moves back. Enter selects the highlighted option and Escape closes the list. Keep labels meaningful when read without their decorative icons.
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
- Use a dropdown for a short, manageable list of related options with clear labels.
- For two or three choices, use radio buttons or a button group instead.
- Show an error with a message that explains how to fix the selection.