Components
- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Hooks
Installation#
pnpm dlx shadcn@latest add @shark/radio-group
Anatomy#
RadioGroup └── RadioGroupItem
Usage#
import { RadioGroup, RadioGroupItem, } from "@/components/ui/radio-group";
<RadioGroup> <RadioGroupItem value="item-1">{/* label */}</RadioGroupItem> <RadioGroupItem value="item-2">{/* label */}</RadioGroupItem> </RadioGroup>
Controlled#
Use the value and onValueChange props to control the radio group.
Select the option comfortable
❌
States#
Invalid#
Use the invalid prop on RadioGroup to indicate an invalid state.
Disabled#
Use the disabled on RadioGroup to disable all the radio group items or on RadioGroupItem to disable a single item.
Examples#
With Description#
Use FieldDescription to add a description to the radio group.
Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.
Card Style#
Use FieldLabel to wrap the entire Field for a clickable card-style selection.
For growing businesses.
For large teams and enterprises.
API Reference#
RadioGroup#
Root component. Manages single selection from options.
| Prop | Type | Default |
|---|---|---|
value | string | - |
defaultValue | string | - |
disabled | boolean | false |
name | string | - |
onValueChange | (details: ValueChangeDetails) => void | - |
className | string | - |
RadioGroupItem#
Single radio option. Use value for selection.
| Prop | Type | Default |
|---|---|---|
value | string | - |
disabled | boolean | false |
invalid | boolean | false |
className | string | - |
For a complete list of props, see the Ark UI documentation.