# gorhom/react-native-bottom-sheet architecture

> Architecture diagram of the GitHub repository gorhom/react-native-bottom-sheet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gorhom/react-native-bottom-sheet
- Repository: https://github.com/gorhom/react-native-bottom-sheet

## Overview

##### Main Components Layer
a. Base Components
b. Modal Components
c. Scrollable Components
d. Utility Components

##### Component Relationships

**Core Components:**
- BottomSheet (Main Component)
- BottomSheetModal
- Supporting Components
- BottomSheetBackdrop
- BottomSheetBackground
- BottomSheetHandle
- BottomSheetFooter
- BottomSheetView

##### Integration Layer
- Connections to external dependencies:
- React Native Reanimated
- React Native Gesture Handler
- React Navigation (optional integration)
- FlashList (optional integration)

##### Feature Modules
- Gesture Handling System
- Animation System
- Keyboard Management
- Modal Management
- Scrollable Management

##### Data Flow
- Gesture input flow
- Animation state updates
- Modal state management
- Scroll event handling

##### Technical Details
- Components using React Context
- Shared state management
- Event propagation paths
- Platform-specific implementations (iOS/Android/Web)

##### Implementation Notes
Callouts for:
- TypeScript types and interfaces
- Performance optimizations
- Platform-specific behaviors
- Animation configurations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core
        BS["Core Bottom Sheet"]
        BSM["Bottom Sheet Modal"]
        
        BS --> BSM
    end

    subgraph "Supporting Components"
        BSB["Bottom Sheet Backdrop"]
        BSBG["Bottom Sheet Background"]
        BSH["Bottom Sheet Handle"]
        BSF["Bottom Sheet Footer"]
        BSV["Bottom Sheet View"]
    end

    subgraph "Feature Modules"
        GHS["Gesture Handling System"]
        AS["Animation System"]
        KM["Keyboard Management"]
        MM["Modal Management"]
        SM["Scrollable Management"]
    end

    subgraph "External Dependencies"
        RNR["React Native Reanimated"]
        RNGH["React Native Gesture Handler"]
        RN["React Navigation"]
        FL["FlashList"]
    end

    BS --> BSB
    BS --> BSBG
    BS --> BSH
    BS --> BSF
    BS --> BSV

    BS --> GHS
    BS --> AS
    BS --> KM
    BSM --> MM
    BS --> SM

    GHS --> RNGH
    AS --> RNR
    BS -.-> RN
    BS -.-> FL

    classDef core fill:#2374ab
    classDef support fill:#48a9a6
    classDef feature fill:#4ad66d
    classDef external fill:#9163cb
    classDef optional stroke-dasharray: 5 5

    class BS,BSM core
    class BSB,BSBG,BSH,BSF,BSV support
    class GHS,AS,KM,MM,SM feature
    class RNR,RNGH,RN,FL external
    class RN,FL optional

    click BS "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheet/BottomSheet.tsx"
    click BSM "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetModal/BottomSheetModal.tsx"
    click BSB "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx"
    click BSBG "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetBackground/BottomSheetBackground.tsx"
    click BSH "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetHandle/BottomSheetHandle.tsx"
    click BSF "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetFooter/BottomSheetFooter.tsx"
    click BSV "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetView/BottomSheetView.tsx"
    click GHS "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetGestureHandlersProvider/BottomSheetGestureHandlersProvider.tsx"
    click MM "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetModalProvider/BottomSheetModalProvider.tsx"
    click SM "https://github.com/gorhom/react-native-bottom-sheet/tree/master/src/components/bottomSheetScrollable"
    click KM "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/hooks/useKeyboard.ts"
    click AS "https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/hooks/useAnimatedSnapPoints.ts"
```
