### Start Example App Packager Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/CONTRIBUTING.md Starts the Metro server for the example application. This is necessary to run the example app. ```sh yarn example start ``` -------------------------------- ### Install adapter dependencies Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/getting-started.md Install specific dependencies based on the chosen adapter. Only install what is required for your implementation. ```bash # For GorhomSheetAdapter (default bottom sheet adapter) yarn add @gorhom/bottom-sheet react-native-gesture-handler # For ModalAdapter — no extra dependencies (uses React Native's built-in Modal) # For ReactNativeModalAdapter yarn add react-native-modal # For ActionsSheetAdapter yarn add react-native-actions-sheet # For SwmansionSheetAdapter (native / New Architecture only) yarn add @swmansion/react-native-bottom-sheet react-native-safe-area-context # Optional — only for SwmansionSheetAdapter's keyboardBehavior="inset" yarn add react-native-keyboard-controller ``` -------------------------------- ### Install core library Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/getting-started.md Install the main package using yarn. ```bash yarn add react-native-bottom-sheet-stack ``` -------------------------------- ### Run Example App on Web Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/CONTRIBUTING.md Builds and runs the example application in a web browser. ```sh yarn example web ``` -------------------------------- ### Start Local Development Server Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/README.md Starts a local development server for live previewing changes. The server opens automatically in a browser. ```bash yarn start ``` -------------------------------- ### Run Example App on iOS Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/CONTRIBUTING.md Builds and runs the example application on an iOS simulator or device. ```sh yarn example ios ``` -------------------------------- ### Run Example App on Android Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/CONTRIBUTING.md Builds and runs the example application on an Android device or emulator. ```sh yarn example android ``` -------------------------------- ### Install SwmansionSheetAdapter dependencies Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/built-in-adapters/swmansion.md Install the required packages for the Swmansion bottom sheet adapter. ```bash npm install @swmansion/react-native-bottom-sheet react-native-safe-area-context ``` -------------------------------- ### Install Dependencies Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/README.md Installs project dependencies using Yarn. Run this command after cloning the repository. ```bash yarn ``` -------------------------------- ### Install peer dependencies Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/getting-started.md Install the required peer dependencies for the library to function. ```bash yarn add react-native-reanimated react-native-safe-area-context react-native-teleport zustand ``` -------------------------------- ### Install keyboard avoidance dependency Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/built-in-adapters/swmansion.md Install the optional peer dependency required for the keyboardBehavior='inset' prop. ```bash npm install react-native-keyboard-controller ``` -------------------------------- ### Setup Provider and Host Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/getting-started.md Wrap the application with the manager provider and place the host outside the scale view. ```tsx import { BottomSheetManagerProvider, BottomSheetHost, BottomSheetScaleView, } from 'react-native-bottom-sheet-stack'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { SafeAreaProvider } from 'react-native-safe-area-context'; export default function App() { return ( ); } ``` -------------------------------- ### Quick Example: Setting up and using react-native-bottom-sheet-stack Source: https://github.com/arekkubaczkowski/react-native-bottom-sheet-stack/blob/main/docs/docs/intro.md This example demonstrates how to set up the BottomSheetManagerProvider, define a custom bottom sheet component, and open it using the useBottomSheetManager hook. It includes the necessary imports and component structures for basic integration. ```tsx import { forwardRef } from 'react'; import { View, Text, Button } from 'react-native'; import { BottomSheetView } from '@gorhom/bottom-sheet'; import { BottomSheetManagerProvider, BottomSheetHost, BottomSheetScaleView, useBottomSheetManager, useBottomSheetContext, } from 'react-native-bottom-sheet-stack'; import { GorhomSheetAdapter } from 'react-native-bottom-sheet-stack/gorhom'; // 1. Define a bottom sheet component const MySheet = forwardRef((props, ref) => { const { close } = useBottomSheetContext(); return ( Hello from Bottom Sheet!