Skip to content

Select / Multiselect

What component has

Keyboard support for select and multiselect lists

Keyboard support
KeyFunction
TabMoves focus to the next focusable element.
Shift + TabMoves focus to the previous focusable element.
Space , Enter , Down ArrowWhen focus is on the trigger, opens the dropdown.
Up Arrow , Down ArrowMoves focus between the options in the dropdown. If focus is on the last/first option, moves focus to the first/last option respectively.
Space , EnterSelects the option and closes the dropdown.
EscCloses the dropdown and returns focus to the trigger.

Roles and attributes for listbox

The list below describes roles and attributes that component already has.

Roles and attributes
RoleAttributeElementUsage
buttondivIdentifies Select. Trigger as a button. Accessible name for the button is defined by the text content of the element or by adding aria-label .
listboxdivIdentifies the element as a listbox .
optiondivIdentifies the element as a listbox option. The text content of the element provides the accessible name of the option.
checkboxdivIdentifies the div element as a checkbox. The child text content of this div provides the accessible name of the checkbox.
aria-selected="true"liSpecified on an option in the listbox when it is visually highlighted as selected. Occurs only when an option in the list is referenced by aria-activedescendant .
aria-label="List of options"divDefines a string value that labels an interactive element. It is required props for select without text content.

Roles and attributes for combobox

The list below describes roles and attributes that component already has.

Roles and attributes
RoleAttributeElementUsage
comboboxdivIdentifies the input as a combobox .
aria-labelledby="#IDREF"divIdentifies the element that labels the combobox.
aria-controls="#IDREF"divIdentifies the element that serves as the popup.
aria-expanded="false"divIndicates that the popup element isn’t displayed.
aria-expanded="true"divIndicates that the popup element is displayed.
aria-activedescendant="IDREF"divWhen an option in the listbox is visually indicated as having keyboard focus, refers to that option. When navigation keys, such as Down Arrow , are pressed, the JavaScript changes the value. Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element.
aria-autocompletedivIndicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox , searchbox , or textbox and specifies how predictions will be presented if they are made.
aria-haspopupdivIndicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.

Considerations for developers

Roles and attributes

The list below will help you to keep in mind the necessary roles and attributes to make our components fully accessible in the particular cases in your interfaces.

Roles and attributes
RoleAttributeElementUsage
aria-labeldivDefines a string value that labels an interactive element. It is required props for select without text content.

Resources

Other recommendations

See more accessibility recommendations in the common Accessibility guide.

Automated screen reader testing

Intergalactic v15.29.0, React v18.2.0, Playwright v1.25.1, Guidepup v0.13.1, MacOS Monterey 12.

Running screen reader against this file.

1. Screen reader goes into the active element.
2. Screen reader says "Select option list box pop up button".
3. Screen reader presses the "Control+Option+Space" button.
4. Screen reader presses the "Tab" button.
5. Screen reader says "Entering Select option list box. Select option group".
6. Screen reader goes into the active element.
7. Screen reader says "In Select option list box Option 0 text (1 of 6)".
8. Screen reader goes to the next element.
9. Screen reader says "Option 1 text (2 of 6)".
10. Screen reader presses the "Control+Option+Space" button.
11. Screen reader says "Label 1 Select option list box pop up button".
1. Screen reader goes into the active element.
2. Screen reader says "Select option list box pop up button".
3. Screen reader presses the "Control+Option+Space" button.
4. Screen reader presses the "Tab" button.
5. Screen reader says "Entering Select option list box. Select option group".
6. Screen reader goes into the active element.
7. Screen reader says "In Select option list box Option 0 text (1 of 6)".
8. Screen reader goes to the next element.
9. Screen reader says "Option 1 text (2 of 6)".
10. Screen reader presses the "Control+Option+Space" button.
11. Screen reader says "Label 1 Select option list box pop up button".

Released under the MIT License.

Released under the MIT License.