Skip to main content

RadioButton

Select one option. Use RadioGroup when you have a labeled list of choices.

RadioButton in a native Kindle example

Usage​

Save this example as apps/Reader/App.js in the starter app.

import React, {useState} from 'react';
import {RadioButton, Text, View} from 'react-kindle';

export default function App() {
const [sort, setSort] = useState('Recent');

return (
<View style={{padding: 24}}>
{['Recent', 'Title'].map(option => (
<View key={option} style={{flexDirection: 'row', alignItems: 'center'}}>
<RadioButton value={sort === option} onValueChange={() => setSort(option)}
accessibilityLabel={option} />
<Text>{option}</Text>
</View>
))}
</View>
);
}

Props​

PropType / defaultDescription
valueboolean = falseWhether this option is selected.
onValueChange(value: true) => voidRuns when an unselected option is pressed.
disabledboolean = falsePrevents selection.
styleView styleDefaults to 44 × 44.
accessibilityLabelstringSpoken option label.