Group container for radio buttons with controlled state.
import { RadioGroup } from "@/components/ui";<RadioGroup
name="size"
options={[
{ value: "sm", label: "Small" },
{ value: "md", label: "Medium" },
{ value: "lg", label: "Large" },
]}
defaultValue="md"
/>Display options in a row
<RadioGroup name="color" orientation="horizontal" options={[ { value: "red", label: "Red" }, { value: "green", label: "Green" }, { value: "blue", label: "Blue" }, ]}/>Add descriptions to options
<RadioGroup name="tier" options={[ { value: "starter", label: "Starter", description: "Best for personal projects" }, { value: "pro", label: "Pro", description: "Best for growing teams" }, { value: "enterprise", label: "Enterprise", description: "Best for large organizations" }, ]}/>Manage selection externally
const [value, setValue] = useState("option1");return ( <RadioGroup name="preference" value={value} onChange={setValue} options={[ { value: "option1", label: "Option 1" }, { value: "option2", label: "Option 2" }, { value: "option3", label: "Option 3" }, ]} />);Configure your app with the features you need and download production-ready code.
Start Configuring