Installation
Add Component
Copy the code snippet below into you components folder.
Integrate Recipe
Integrate this recipe in to your Panda config.
Usage
If you prefer a closed component composition, check out the snippet below.
Examples
Controlled
Pass the value and onValueChange props to the RadioGroup.Root component to
control the selected radio button.
Colors
Pass the colorPalette prop to the RadioGroup.Root component to change the
color scheme of the component.
Sizes
Pass the size prop to the RadioGroup.Root component to change the size of
the radio component.
Disabled
Pass the disabled prop to the RadioGroup.Item component to make the radio
disabled.
Closed Component
Here's how to setup the Radio for a closed component composition.
Here's how to use it:
Props
Root
| Prop | Default | Type | 
|---|---|---|
| variant | 'solid' | 'solid' | 
| size | 'md' | 'sm' | 'md' | 'lg' | 
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| defaultValue | stringThe initial value of the checked radio when rendered. Use when you don't need to control the value of the radio group. | |
| disabled | booleanIf `true`, the radio group will be disabled | |
| form | stringThe associate form of the underlying input. | |
| id | stringThe unique identifier of the machine. | |
| ids | Partial<{
  root: string
  label: string
  indicator: string
  item: (value: string) => string
  itemLabel: (value: string) => string
  itemControl: (value: string) => string
  itemHiddenInput: (value: string) => string
}>The ids of the elements in the radio. Useful for composition. | |
| name | stringThe name of the input fields in the radio (Useful for form submission). | |
| onValueChange | (details: ValueChangeDetails) => voidFunction called once a radio is checked | |
| orientation | 'horizontal' | 'vertical'Orientation of the radio group | |
| readOnly | booleanWhether the checkbox is read-only | |
| value | stringThe controlled value of the radio group | 
Item
| Prop | Default | Type | 
|---|---|---|
| value* | string | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| disabled | boolean | |
| invalid | boolean |