Radio Group
Radio Group Primitive
Demo
A group of selectable buttons, commonly referred to as radio buttons, wherein only one button can be checked simultaneously.
Installation
Copy/paste the following code to ~/components/ui/radio-group.tsx
:
Usage
Props
RadioGroup
Extends View
props
Prop | Type | Note |
---|---|---|
value | string | undefined | |
onValueChange | (val: string) => void | |
asChild | boolean | (optional) |
disabled | boolean | (optional) |
RadioGroupItem
Extends Pressable
props
Prop | Type | Note |
---|---|---|
value | string | |
aria-labelledby | string | Its label’s nativeID |
asChild | boolean | (optional) |