@uiw/react-native
Version:
UIW for React Native
28 lines • 689 B
JavaScript
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;