Radio Group
A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
"use client"
import { Label, RadioGroup, RadioGroupItem } from "uilab-core"
export function RadioGroupPreview() {Usage
import { Label, RadioGroup, RadioGroupItem } from "uilab-core"<RadioGroup defaultValue="option-one">
<div className="flex items-center gap-3">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">Option One</Label>
</div>
<div className="flex items-center gap-3">
<RadioGroupItem value="option-two" id="option-two" />
<Label htmlFor="option-two">Option Two</Label>
</div>
</RadioGroup>Examples
Description
Radio group items with a description using the Field component.
Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.
"use client"
import {
Field,
FieldContent,Choice Card
Use FieldLabel to wrap the entire Field for a clickable card-style selection.
"use client"
import {
Field,
FieldContent,Field set
Use FieldSet and FieldLegend to group radio items with a label and description.
"use client"
import {
Field,
FieldDescription,Disabled
Use the disabled prop on RadioGroup to disable all items.
"use client"
import {
Field,
FieldLabel,Invalid
Use aria-invalid on RadioGroupItem and data-invalid on Field to show validation errors.
"use client"
import {
Field,
FieldDescription,