RadioButton

Radio buttons allow the selection of a single option from a set.

Usage

export default class MyComponent extends Component {
  state = {
    checked: 'firstOption',
  };

  render() {
    const { checked } = this.state;
    return (
      <View>
        <RadioButton
          value="firstOption"
          checked={checked === 'firstOption'}
          onPress={() => { this.setState({ checked: 'firstOption' }); }}
        />
        <RadioButton
          value="secondOption"
          checked={checked === 'secondOption'}
          onPress={() => { this.setState({ checked: 'secondOption' }); }}
        />
      </View>
    );
  }
}

Props

checked (required)
Type: boolean

Whether radio is checked.

disabled
Type: boolean

Whether radio is disabled.

onPress
Type: Function

Function to execute on press.

color
Type: string

Custom color for radio.

theme
Type: Theme