Scrollable Bottom Sheet with Reanimated and Gesture Handler
Wednesday, October 11, 2023
demos
scrollable-bottom-sheet
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A multi-page bottom sheet with horizontal and vertical scrolling.
What's This About?
This component creates an interactive bottom sheet that supports both vertical and horizontal scrolling between pages. Each page can have its own height and content, with smooth transitions between states. The implementation includes a gradient button trigger, page navigation controls, and programmatic scrolling methods, making it suitable for complex modal interfaces.
Technical Implementation
The component uses:
Multi-page navigation
Vertical/horizontal scrolling
Height management
Gradient effects
Ref-based control
Usage
// Page configuration
const pages = [
{
height: 350,
component: (
<BottomSheetPage
onPress={() => {
bottomSheetRef.current?.scrollToX(windowWidth);
}}
buttonTitle="Next Page"
/>
),
},
{
height: 500,
component: (
<BottomSheetPage
onPress={() => {
bottomSheetRef.current?.scrollToX(windowWidth * 2);
}}
buttonTitle="Next Page"
/>
),
},
];
// Basic usage
<ScrollableBottomSheet ref={bottomSheetRef} pages={pages} />;
// Control methods
bottomSheetRef.current?.scrollToY(-pageHeight);
bottomSheetRef.current?.scrollToX(windowWidth);
bottomSheetRef.current?.close();
bottomSheetRef.current?.isActive();
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Scrollable Bottom Sheet
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback