UNPKG

@uiw/react-native

Version:
19 lines (18 loc) 666 B
import React from 'react'; import { View } from 'react-native'; import Radio from '../../Radio'; import Flex from '../../Flex'; const FormRadio = ({ value, onChange, options = [], ...others }) => { return (<React.Fragment> <Flex justify="start" wrap="wrap" style={{ paddingTop: 15 }}> {options.map((item, idx) => (<View key={idx} style={{ marginRight: 15, marginBottom: 15 }}> <Radio checked={item.value === value} onPress={() => { onChange?.(item.value); }} {...others}> {item.label} </Radio> </View>))} </Flex> </React.Fragment>); }; export default FormRadio;