Bottom Sheet
- You use the BottomSheet
component to avoid cluttering up the main content. The sheet starts off collapsed and the user expands it by dragging. In our example application, when the user opens an email we display the sender's information in a BottomSheet
. The peekHeight
determines how much of the sender the user sees to start with. We turn on nested scrolling so that expanding the sheet seamlessly scrolls the sender.
+ You use the BottomSheet
component to avoid cluttering up the main content. The sheet starts off collapsed and the user expands it by dragging. In our example application, when the user opens an email we display the sender's information in a BottomSheet
. We turn on nested scrolling so that the sheet's content scrolls seamlessly on Android when the user expands it.
import {BottomSheet} from 'navigation-react-native';
-<BottomSheet modal={true} peekHeight={200}>
+<BottomSheet modal={true}>
<ScrollView nestedScrollEnabled={true} />
</BottomSheet>
Note
- On iOS, the animation isn't completely smooth. Removing the stutter when dragging the sheet quickly will have to wait until React Native introduces synchronous view resizing. + On iOS, the animation isn't completely smooth. Removing the stutter, when quickly dragging the sheet, will have to wait until React Native introduces synchronous view resizing.Non-modal Bottom Sheet (Android)
- The BottomSheet
is 100% native so it must be a child of a CoordinatorLayout
on Android.
+ You can also have a non-modal BottomSheet
on Android. The BottomSheet
is 100% native so it must be a child of a CoordinatorLayout
. In our email example, we make the sheet non-modal so the user can compose a reply while viewing the sender's details.
<CoordinatorLayout>
<BottomSheet modal={false}>