Skip to main content

radio

Radio​

const Radio = () => {
const [pricing, setPricing] = useState(0);

const price = [
{
name: 100,
id: 1
},
{
name: 200,
id: 2
},
{
name: 300,
id: 3
}
];
return (
<>
<Layout style={{ flexDirection: "row", flexWrap: "wrap" }}>
{price.map((e, i) => (
<Radio
key={i}
title={e.name}
onPress={() => setPricing(e.id)}
selected={e.id === pricing}
/>
))}
</Layout>
</>
);
};

export default Radio;

Api References for Radio

ParameterTypeDescription
Pressing voidon press
iconsobject itemcheckbox icon
titlestringcheck box title text
styleanyyour custom styles