Skip to main content

RadioGroup

Choose one value from a list of labeled options.

RadioGroup in a native Kindle example

Usage​

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

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

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

return (
<View style={{padding: 24}}>
<RadioGroup value={sort} onValueChange={setSort} options={[
{value: 'recent', label: 'Recent'},
{value: 'title', label: 'Title'},
{value: 'author', label: 'Author', disabled: true},
]} />
</View>
);
}

Props​

PropType / defaultDescription
optionsarrayEntries have value, label, and optional disabled.
valueoption valueCurrently selected option.
onValueChange(value) => voidReceives the chosen option value.
disabledboolean = falseDisables the entire group.