import { Field } from '@base-ui/react/radio-group';
const options = [
{
value: 'email',
label: 'Email',
description: 'Receive notifications via email',
},
{
value: 'sms',
label: 'SMS',
description: 'Receive notifications via text message',
},
{
value: 'push',
label: 'Push',
description: 'Receive push notifications on your device',
},
];
<RadioGroup>
{options.map((option) => (
<Field.Root key={option.value}>
<div className="flex gap-3">
<Radio.Root value={option.value}>
<Radio.Indicator />
</Radio.Root>
<div>
<Field.Label>{option.label}</Field.Label>
<Field.Description>{option.description}</Field.Description>
</div>
</div>
</Field.Root>
))}
</RadioGroup>