Components
Radio Group
Picks one option from a set, as plain radios or selectable option rows.
Ombelle · light
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add radio-groupAdds components/ui/radio-group.tsx and installs react, @radix-ui/react-radio-group, clsx, tailwind-merge with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import {
RadioGroup, RadioGroupItem, RadioGroupOption, RadioGroupOptionLabel,
} from '@/components/ui/radio-group'
export function PlanPicker() {
return (
<RadioGroup defaultValue="team" aria-label="Plan">
<RadioGroupOption>
<RadioGroupItem value="starter" />
<RadioGroupOptionLabel>Starter</RadioGroupOptionLabel>
</RadioGroupOption>
<RadioGroupOption>
<RadioGroupItem value="team" />
<RadioGroupOptionLabel>Team</RadioGroupOptionLabel>
</RadioGroupOption>
</RadioGroup>
)
}API and states
- API
- RadioGroup, RadioGroupItem, RadioGroupOption, RadioGroupOptionLabel, RadioGroupOptionDescription
- Minimum states
- Checked, unchecked, disabled, invalid, focus
- Native basis
- Reviewed Radix radio group primitive
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.