Logo

RadioButton

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

Android (enabled)
Android (disabled)
iOS (enabled)
iOS (disabled)

Usage

import * as React from 'react';
import { View } from 'react-native';
import { RadioButton } from 'react-native-paper';

const MyComponent = () => {
  const [checked, setChecked] = React.useState('first');

  return (
    <View>
      <RadioButton
        value="first"
        status={ checked === 'first' ? 'checked' : 'unchecked' }
        onPress={() => setChecked('first')}
      />
      <RadioButton
        value="second"
        status={ checked === 'second' ? 'checked' : 'unchecked' }
        onPress={() => setChecked('second')}
      />
    </View>
  );
};

export default MyComponent;

Props

Type: string

Value of the radio button

Type: 'checked' | 'unchecked'

Status of radio button.

Type: boolean

Whether radio is disabled.

Type: () => void

Function to execute on press.

Type: string

Custom color for unchecked radio.

Type: string

Custom color for radio.

Type: Theme
Type: string

testID to be used on tests.

Edit this page