Skip to main content

Radio

Deprecated

Product subscription app extensions won't be supported as of December 3, 2025. You should migrate existing product subscription app extensions to purchase options extensions.

Radio allows merchants to choose a single item from a list.

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

extend('Playground', (root) => {
const radio1 = root.createComponent(Radio, {
label: 'Option 1',
helpText: 'Help text for option 1.',
checked: true,
id: 'option1',
name: 'greatOptions',
onChange: () => console.log('Option 1 selected'),
});

const radio2 = root.createComponent(Radio, {
label: 'Option 2',
helpText: 'Help text for option 2.',
id: 'option2',
name: 'greatOptions',
checked: false,
onChange: () => console.log('Option 2 selected'),
});

root.appendChild(radio1);
root.appendChild(radio2);
root.mount();
});
import React from 'react';
import {extend, render, Radio} from '@shopify/admin-ui-extensions-react';

function App() {
return (
<>
<Radio
label="Option 1"
helpText="Help text for option 1."
checked
id="option1"
name="greatOptions"
onChange={() => console.log('Option 1 selected')}
/>
<Radio
label="Option 2"
helpText="Help text for option 2."
id="option2"
name="greatOptions"
checked={false}
onChange={() => console.log('Option 2 selected')}
/>
);
}

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

optional = ?

NameTypeDescription
label?stringLabel for the radio button.
helpText?stringAdditional text to aid in use.
checked?booleanRadio button is selected.
id?stringUnique ID for radio button.
namestringUse name to group radio buttons together by giving them the same name.
value?stringValue of selected input on selected
onChange?(newValue: string) => voidCallback when the radio button is toggled.
✅ Do🛑 Don't
Use Radio to give merchants a single select choiceHorizontally stack Radio options
Vertically align Radio options

For more guidelines, refer to Polaris' Radio button best practices.


Was this page helpful?