Skip to main content

OptionList

Deprecated

Product subscription app extensions won't be supported as of February 9, 2026. You should migrate existing product subscription app extensions to purchase options extensions.

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.

import {extend, OptionList} from '@shopify/admin-ui-extensions';

extend('Playground', (root) => {
const options = [
{label: 'Red', value: 'red', disabled: false},
{label: 'Green', value: 'green', disabled: false},
{label: 'Blue', value: 'blue', disabled: false},
];
let selected = [];

const list = root.createComponent(OptionList, {
title: 'OptionList title',
options,
allowMultiple: true,
selected,
onChange: (newSelected) => {
console.log(`option selected: ${newSelected}`);
selected = newSelected;
},
});
root.appendChild(list);

root.mount();
});
import React, {useState} from 'react';
import {extend, render, OptionList} from '@shopify/admin-ui-extensions-react';

function App() {
const options = [
{label: 'Red', value: 'red', disabled: false},
{label: 'Green', value: 'green', disabled: false},
{label: 'Blue', value: 'blue', disabled: false},
];

const [selected, setSelected] = useState([]);

return (
<OptionList
title="OptionList title"
options={options}
selected={selected}
allowMultiple
onChange={(newSelected) => {
setSelected(newSelected);
console.log(`options selected: ${newSelected}`);
}}
/>
);
}

extend(
'Playground',
render(() => <App />),
);

optional = ?

NameTypeDescription
title?stringTitle to display above the list
options?OptionDescriptor[]Array of options to be listed
selectedstring[]Array of selected options
allowMultiple?booleanAllow more than one option to be selected
onChange(selected: string[]) => voidCallback when selection changes

NameTypeDescription
valuestringValue of the option
labelstringDisplay label for the option
disabled?booleanWhether the option is disabled or not

✅ Do🛑 Don't
Use OptionList to present either a single choice or multi choice listHave only a single item

For more guidelines, refer to Polaris' Option List best practices.


Was this page helpful?