OptionList
Note: This component is not available in Product Subscription extensions.
Option lists let you create grouped items. This can include single selection or multiple selection of options. Option lists are styled differently than choice lists and should not be used within a form, but as a standalone menu.
optional = ?
Name | Type | Description |
---|---|---|
title? | string |
Title to display above the list |
options? | OptionDescriptor[] |
Array of options to be listed |
selected | string[] |
Array of selected options |
allowMultiple? | boolean |
Allow more than one option to be selected |
onChange | (selected: string[]) => void |
Callback when selection changes |
OptionDescriptor
Anchor link to section titled "OptionDescriptor"Name | Type | Description |
---|---|---|
value | string |
Value of the option |
label | string |
Display label for the option |
disabled? | boolean |
Whether the option is disabled or not |
✅ Do | 🛑 Don't |
---|---|
Use OptionList to present either a single choice or multi choice list | Have only a single item |
For more guidelines, refer to Polaris' Option List best practices.