Skip to main content

ChoiceList

The choiceList component presents multiple options for single or multiple selections. Use it when merchants need to choose from a defined set of options, such as filtering results or collecting preferences.

The component supports both single selection (radio button behavior) and multiple selection (checkbox behavior) modes. It offers multiple layout variants including list, inline, block, and grid formats to suit different space constraints and visual requirements.


Configure the following properties on the choiceList component.

Configure the following properties on the choice list component.

string

A unique identifier for the element.

Anchor to multiple
multiple
boolean
Default: false

Whether multiple choices can be selected.

Anchor to values
values
string[]

An array of the values of the selected options.

This is a convenience prop for setting the selected prop on child options.


The choiceList component provides event callbacks for handling user interactions. Learn more about handling events.

The choice list component provides event callbacks for handling user interactions. Learn more about handling events.

Anchor to change
change
(event: <"s-choice-list">) => void

Callback when the user changes a choice. Fires simultaneously with onInput.

Anchor to input
input
(event: <"s-choice-list">) => void

Callback when the user changes a choice. Fires simultaneously with onChange.


The Choice component creates options that let merchants select one or multiple items from a list of choices.

The choice component creates options that let merchants select one or multiple items from a list of choices.

Anchor to disabled
disabled
boolean
Default: false

Disables the control, disallowing any interaction.

string

A unique identifier for the element.

Anchor to selected
selected
boolean
Default: false

Whether the control is active.

Anchor to value
value
string

The value used in form data when the control is checked.



  • Choose appropriate selection modes: Use single selection for mutually exclusive options. Enable multiple when merchants can select more than one.
  • Write clear, concise choice labels: Keep labels short but descriptive enough that merchants understand each option without additional explanation.

choiceList component types other than Choice can't be used as options within the choice list.


Was this page helpful?