Inputs and selection
Radio group
RadioGroupItem value id · a Label htmlFor the same id names it
function RadioGroupDemo() { const [value, setValue] = React.useState('comfortable'); const pick = (v: string) => { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); setValue(v); }; return ( <RadioGroup value={value} onValueChange={pick}> {[ ['default', 'Default'], ['comfortable', 'Comfortable'], ['compact', 'Compact'], ].map(([v, label]) => ( <View key={v} className="flex-row items-center gap-3"> <RadioGroupItem value={v} id={`ks-radio-${v}`} /> <Label htmlFor={`ks-radio-${v}`} onPress={() => pick(v)}> {label} </Label> </View> ))} </RadioGroup> );}API
<RadioGroup value onValueChange><RadioGroupItem value id /></RadioGroup>Get it
Already in every copy of the native kit:
import { RadioGroup } from '@/components/ui/radio-group';Details
- Exports
RadioGroup- Packages
- @rn-primitives/radio-group@^1.5.2
- Installs with
- @halftone-native/label, @halftone-native/lib-utils
- Also searched as
- single choice, option
- Registry JSON
- /r/native/radio-group.json
<RadioGroup defaultValue="monthly" aria-label="Billing period"> {['monthly', 'yearly'].map((v) => ( <div key={v} className="flex items-center gap-2"> <RadioGroupItem value={v} id={`demo-r-${v}`} /> <Label htmlFor={`demo-r-${v}`} className="capitalize"> {v} </Label> </div> ))}</RadioGroup>API
<RadioGroup value onValueChange><RadioGroupItem value id /></RadioGroup>Get it
Already in every copy of the web kit:
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';Details
- Exports
RadioGroup,RadioGroupItem- Packages
- cn@^0.5.2, lucide-react@^1.52.0, radix-ui@^1.7.0
- Registry JSON
- /r/web/radio-group.json
Agents: the whole registry is at /llms.txt.