### Installation Source: https://gorhom.dev/react-native-bottom-sheet Install the library using yarn. ```bash yarn add @gorhom/bottom-sheet@^5 ``` -------------------------------- ### Install Redash Source: https://gorhom.dev/react-native-bottom-sheet/custom-handle To use the custom handle example, you need to install `react-native-redash`. ```bash yarn add react-native-redash ``` -------------------------------- ### Simple Keyboard Handling Example Source: https://gorhom.dev/react-native-bottom-sheet/keyboard-handling An example demonstrating basic keyboard handling using BottomSheetTextInput. ```javascript import React, { useMemo } from "react"; import { View, StyleSheet } from "react-native"; import BottomSheet, { BottomSheetTextInput } from "@gorhom/bottom-sheet"; const App = () => { // variables const snapPoints = useMemo(() => ["25%"], []); // renders return ( ); }; const styles = StyleSheet.create({ container: { flex: 1, padding: 24, backgroundColor: "grey", }, textInput: { alignSelf: "stretch", marginHorizontal: 12, marginBottom: 12, padding: 12, borderRadius: 12, backgroundColor: "grey", color: "white", textAlign: "center", }, contentContainer: { flex: 1, alignItems: "center", }, }); export default App; ``` -------------------------------- ### Example Source: https://gorhom.dev/react-native-bottom-sheet/components/bottomsheettextinput A basic example demonstrating the usage of BottomSheetTextInput within a BottomSheet component. ```javascript import React, { useCallback, useMemo, useRef } from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import BottomSheet, { BottomSheetView, BottomSheetTextInput } from '@gorhom/bottom-sheet'; const App = () => { // ref const bottomSheetRef = useRef(null); // variables const snapPoints = useMemo(() => ['25%', '50%'], []); // callbacks const handleSheetChanges = useCallback((index: number) => { console.log('handleSheetChanges', index); }, []); // renders return ( Awesome 🎉 ); }; const styles = StyleSheet.create({ container: { flex: 1, padding: 24, backgroundColor: 'grey', }, contentContainer: { flex: 1, alignItems: 'center', }, input: { marginTop: 8, marginBottom: 10, borderRadius: 10, fontSize: 16, lineHeight: 20, padding: 8, backgroundColor: 'rgba(151, 151, 151, 0.25)', }, }); export default App; ``` -------------------------------- ### Expo Installation Source: https://gorhom.dev/react-native-bottom-sheet Install the required dependencies for Expo projects. ```bash npx expo install react-native-reanimated react-native-gesture-handler ``` -------------------------------- ### Example Source: https://gorhom.dev/react-native-bottom-sheet/components/bottomsheetvirtualizedlist This example demonstrates how to use BottomSheetVirtualizedList with BottomSheet, including data, snap points, and rendering items. ```javascript import React, { useCallback, useRef, useMemo } from "react"; import { StyleSheet, View, Text, Button } from "react-native"; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import BottomSheet, { BottomSheetVirtualizedList } from "@gorhom/bottom-sheet"; const App = () => { // hooks const sheetRef = useRef(null); // variables const data = useMemo( () => Array(50) .fill(0) .map((_, index) => `index-${index}`), [] ); const snapPoints = useMemo(() => ["25%", "50%", "90%"], []); // callbacks const handleSheetChange = useCallback((index) => { console.log("handleSheetChange", index); }, []); const handleSnapPress = useCallback((index) => { sheetRef.current?.snapToIndex(index); }, []); const handleClosePress = useCallback(() => { sheetRef.current?.close(); }, []); // render const renderItem = useCallback( ({ item }) => ( {item} ), [] ); return (