react-native-ui-lib
Version:
[](https://stand-with-ukraine.pp.ua)
39 lines (38 loc) • 1.69 kB
JSON
{
"name": "RadioGroup",
"category": "controls",
"description": "Wrap a group of Radio Buttons to automatically control their selection",
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/RadioButtonScreen.js",
"images": [
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/RadioButton/Default.gif?raw=true",
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/RadioButton/Alignment.gif?raw=true",
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/RadioButton/Custom.gif?raw=true",
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/RadioButton/Individual.png?raw=true"
],
"props": [
{
"name": "initialValue",
"type": "string | number | boolean",
"description": "The initial value of the selected radio button"
},
{
"name": "onValueChange",
"type": "((value?: string) => void) | ((value?: number) => void) | ((value?: boolean) => void) | ((value?: any) => void)",
"description": "Invoked once when value changes, by selecting one of the radio buttons in the group"
}
],
"snippet": [
"function Example(props) {",
" const [currentValue, setCurrentValue] = useState('yes');",
" return (",
" <View flex padding-s5>",
" <RadioGroup initialValue={currentValue} onValueChange={setCurrentValue} gap-s4>",
" <RadioButton value={'yes'} label={'Yes'}/>",
" <RadioButton value={'no'} label={'No'}/>",
" <RadioButton value={'maybe'} label={'Maybe'}/>",
" </RadioGroup>",
" </View>",
" );",
"}"
]
}