Skip to main content

RadioGroup
component

A radio group component for single-selection options. You can view the Storybook for more interactive examples.

Was this section helpful?

RadioGroup

import {RadioGroup, RadioGroupItem, Label} from '@shopify/shop-minis-react'

export default function MyComponent() {
return (
<RadioGroup defaultValue="option-1">
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-1" id="option-1" />
<Label>Option 1</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-2" id="option-2" />
<Label>Option 2</Label>
</div>
</RadioGroup>
)
}

Preview

RadioGroup configurations and states

A radio group with selectable options

A disabled radio group

Was this section helpful?

Default radio group

import {RadioGroup, RadioGroupItem, Label} from '@shopify/shop-minis-react'

export default function MyComponent() {
return (
<RadioGroup defaultValue="option-1">
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-1" id="option-1" />
<Label>Option 1</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-2" id="option-2" />
<Label>Option 2</Label>
</div>
</RadioGroup>
)
}