Skip to main content

BottomSheet

Show a short task or set of options in a native modal window at the bottom of the screen.

BottomSheet in a native Kindle example

Usage​

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

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

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

return (
<View style={{flex: 1, padding: 24}}>
<Button onPress={() => setVisible(true)}>Sort books</Button>
<BottomSheet visible={visible} title="Sort books" height={360}
onDismiss={() => setVisible(false)}>
<RadioGroup value={sort} onValueChange={setSort} options={[
{value: 'recent', label: 'Recent'}, {value: 'title', label: 'Title'},
]} />
<Button onPress={() => setVisible(false)}>Done</Button>
</BottomSheet>
</View>
);
}

Props​

PropType / defaultDescription
visiblebooleanWhether the sheet is open.
titlestringOptional heading.
heightnumber = 360Sheet height in layout units.
childrenReact nodesSheet content.
onDismiss() => voidCalled on downward handle gesture or native dismissal.

The sheet spans the screen width. Update visible in onDismiss to close it.