React Native MantineInputs

Radio

Radio button for exclusive selections

Import: import { Radio } from 'react-native-mantine';

Usage

import { Radio } from 'react-native-mantine';

// Radio with Radio.Group
<Radio.Group value={value} onChange={setValue}>
  <Radio label="React" value="react" />
  <Radio label="Vue" value="vue" />
  <Radio label="Angular" value="angular" />
</Radio.Group>

// Group with custom size and color
<Radio.Group
  value={value}
  onChange={setValue}
  size="lg"
  color="green"
  spacing={16}
>
  <Radio label="Option 1" value="1" />
  <Radio label="Option 2" value="2" />
</Radio.Group>

// Standalone radio
<Radio
  label="Accept terms"
  value="terms"
  checked={accepted}
  onChange={handleChange}
/>

Props

PropTypeDefaultDescription
valuestringCurrently selected radio value (controlled component)
onChange(value: string) => voidCallback fired when any radio in the group is selected
children (required)React.ReactNodeRadio components to be rendered within the group
namestringRadio group name for accessibility purposes
size'xs' | 'sm' | 'md' | 'lg' | 'xl'Radio size applied to all children radios in the group
colorMantineColorRadio color applied to all children radios in the group
styleViewStyleAdditional styles applied to the group wrapper container
spacingnumber12Spacing between radio buttons in the group

Source on GitHub · npm