docs/public/1.0/radio-button.html
Radio buttons allow the selection a single option from a set.
Android (enabled)
Android (disabled)
iOS (enabled)
iOS (disabled)
import * as React from 'react';
import { View } from 'react-native';
import { RadioButton } from 'react-native-paper';
export default class MyComponent extends React.Component {
state = {
checked: 'first',
};
render() {
const { checked } = this.state;
return (
<View>
<RadioButton
value="first"
checked={checked === 'first'}
onPress={() => { this.setState({ checked: 'firstOption' }); }}
/>
<RadioButton
value="second"
checked={checked === 'second'}
onPress={() => { this.setState({ checked: 'secondOption' }); }}
/>
</View>
);
}
}
value (required)
Type: string
Value of the radio button
checked
Type: boolean
Whether radio is checked.
disabled
Type: boolean
Whether radio is disabled.
onPress
Type: () => mixed
Function to execute on press.
uncheckedColor
Type: string
Custom color for unchecked radio.
color
Type: string
Custom color for radio.
theme
Type: Theme