The option list component lets you create a list of grouped items that merchants can pick from. This can include single selection or multiple selection of options. Option list usually appears in a popover, and sometimes in a modal or a sidebar. Option lists are styled differently than choice lists and should not be used within a form, but as a standalone menu.
Use for a group of similar selectable items when only one should be selectable at once.
The option list component should:
- Be placed on its own inside a container. Usually the container behaves like a menu, as it does with popover. Don’t place other components within the same container.
- Not be used when a select component will do.
Each item in an option list should be clear and descriptive.
- Traffic referrer source
- To render a list of actions, use the action list component
- To create a list of grouped radio buttons or checkboxes, use the choice list component
- For a basic version of option list as a single choice menu, use the select component
See Material Design and development documentation about accessibility for Android:
See Apple’s Human Interface Guidelines and API documentation about accessibility for iOS:
Items in an option list are organized as list items (<li>) in an unordered list (<ul>) and are conveyed as a group of related elements to assistive technology users.
If you customize the option list, you can provide ARIA roles that fit the context. These roles must be valid according to the W3C ARIA specification to be conveyed correctly to screen reader users.
- The role prop adds an ARIA role to the option list wrapper
- The optionRole prop adds an ARIA role to the option list items