Skip to content

Radio Group

A group of options where users can select exactly one choice.

---
import { Label } from '@bejamas/registry/ui/label';
import { RadioGroup, RadioGroupItem } from '@bejamas/registry/ui/radio-group';
---
<RadioGroup name="plan" defaultValue="free">
<div class="flex items-center gap-2">
<RadioGroupItem value="free" id="free" />
<Label for="free">Free</Label>
</div>
<div class="flex items-center gap-2">
<RadioGroupItem value="pro" id="pro" />
<Label for="pro">Pro</Label>
</div>
</RadioGroup>
Terminal window
bunx bejamas add radio-group
---
import { RadioGroup, RadioGroupItem } from '@bejamas/ui/components/radio-group';
import { Label } from '@bejamas/ui/components/label';
---
<RadioGroup name="plan" defaultValue="free">
<div class="flex items-center gap-2">
<RadioGroupItem value="free" id="free" />
<Label for="free">Free</Label>
</div>
</RadioGroup>
PropTypeDefault
classstring""
defaultValuestring
namestring
disabledbooleanfalse
readOnlybooleanfalse
requiredbooleanfalse
”aria-label”string
”aria-labelledby”string