Radio Group
Base UISquare radios for choosing one option when you want them all visible.
Install
$ npx shadcn@latest add https://spotcheckui.com/r/radio-group.jsonAlso installs @base-ui/react.
Usage
import { RadioGroup } from "@/components/spotcheck/radio-group"
<RadioGroup
label="Keep traces for"
options={[{ value: "30", label: "30 days" }, { value: "90", label: "90 days" }]}
value={retention}
onValueChange={setRetention}
/>Props
- label * Required
stringDefault —Names the group for screen readers. - options * Required
RadioOption[]Default — - value
stringDefault —The selected option, when you control it. - defaultValue
stringDefault —The starting option, when it manages itself. - onValueChange
(value: string) => voidDefault — - className
stringDefault —
Keyboard
| ↑ ↓ | Move to the next option and choose it |
|---|
Reduced motion
Nothing here animates.