Radio Group Primitive
A group of selectable buttons, commonly referred to as radio buttons, wherein only one button can be checked simultaneously.
Installation
Install the component via your command line.
Install @radix-ui/react-radio-group
Copy/paste the following code for web to ~/components/primitives/radio-group/radio-group.web.tsx
Copy/paste the following code for native to ~/components/primitives/radio-group/radio-group.tsx
Copy/paste the following code for types to ~/components/primitives/radio-group/types.ts
Copy/paste the following code for exporting to ~/components/primitives/radio-group/index.ts
Copy/paste the following code for native to ~/components/primitives/radio-group/index.tsx
Copy/paste the following code for types to ~/components/primitives/radio-group/types.ts
Usage
Props
Root
Extends View
props
Prop | Type | Note |
---|---|---|
value | string | undefined | |
onValueChange | (val: string) => void | |
asChild | boolean | (optional) |
disabled | boolean | (optional) |
Item
Extends Pressable
props
Prop | Type | Note |
---|---|---|
value | string | |
aria-labelledby | string | Its label’s nativeID |
asChild | boolean | (optional) |
Indicator
Extends View
props
Prop | Type | Note |
---|---|---|
forceMount | boolean | (optional) |
asChild | boolean | (optional) |