# apsl/react-native-keyboard-aware-scroll-view architecture

> Architecture diagram of the GitHub repository apsl/react-native-keyboard-aware-scroll-view, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apsl/react-native-keyboard-aware-scroll-view
- Repository: https://github.com/apsl/react-native-keyboard-aware-scroll-view

## Overview

This library wraps React Native scrollable components so keyboard events and focused TextInputs can trigger keyboard-aware scrolling. The main workflow is to use a wrapped scroll view or list, focus an input, then let the HOC measure and scroll it; callers can also request scrolling directly. The README documents the public capabilities, while the sampled HOC excerpt shows keyboard subscriptions, measurement, and scroll behavior. Details of some internal calls are omitted because the excerpt is incomplete.

Main entry points: [`lib/KeyboardAwareHOC.js`](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareHOC.js) (Keyboard HOC), [`index.js`](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/index.js) (Package exports), [`lib/KeyboardAwareScrollView.js`](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareScrollView.js) (Aware ScrollView), [`lib/KeyboardAwareFlatList.js`](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareFlatList.js) (Aware FlatList)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public adapters"]
  node_exports["Package exports<br/>[index.js]"]
  node_scrollview["Aware ScrollView"]
  node_flatlist["Aware FlatList"]
  node_sectionlist["Aware SectionList"]
end

subgraph group_runtime["Keyboard runtime"]
  node_hoc["Keyboard HOC"]
  node_interface["Scroll interface"]
end

node_app(("App / TextInput"))
node_keyboard(("RN Keyboard events"))
node_native["RN scroll / UIManager"]

node_exports -->|"exports"| node_scrollview
node_exports -->|"exports"| node_flatlist
node_exports -->|"exports"| node_sectionlist
node_exports -->|"exports"| node_hoc
node_scrollview -->|"wraps ScrollView"| node_hoc
node_flatlist -->|"wraps FlatList"| node_hoc
node_sectionlist -->|"wraps SectionList"| node_hoc
node_app -->|"uses component"| node_scrollview
node_app -->|"may configure HOC"| node_hoc
node_keyboard -->|"notifies"| node_hoc
node_hoc -->|"measures and scrolls"| node_native
node_hoc -->|"implements"| node_interface

click node_exports "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/index.js"
click node_scrollview "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareScrollView.js"
click node_flatlist "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareFlatList.js"
click node_sectionlist "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareSectionList.js"
click node_hoc "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareHOC.js"
click node_interface "https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareInterface.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_exports,node_scrollview,node_flatlist,node_sectionlist toneBlue
class node_hoc,node_interface toneAmber
class node_app,node_keyboard,node_native toneIndigo
```

## Components

### Public adapters

- [Package exports](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/index.js): `index.js`
- [Aware ScrollView](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareScrollView.js): `lib/KeyboardAwareScrollView.js`
- [Aware FlatList](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareFlatList.js): `lib/KeyboardAwareFlatList.js`
- [Aware SectionList](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareSectionList.js): `lib/KeyboardAwareSectionList.js`

### Keyboard runtime

- [Keyboard HOC](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareHOC.js): `lib/KeyboardAwareHOC.js`
- [Scroll interface](https://github.com/apsl/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareInterface.js): `lib/KeyboardAwareInterface.js`

### Other components

- **App / TextInput**
- **RN Keyboard events**
- **RN scroll / UIManager**

## Connections

- Package exports → Aware ScrollView: exports (evidence: `index.js`)
- Package exports → Aware FlatList: exports (evidence: `index.js`)
- Package exports → Aware SectionList: exports (evidence: `index.js`)
- Package exports → Keyboard HOC: exports (evidence: `index.js`)
- Aware ScrollView → Keyboard HOC: wraps ScrollView (evidence: `lib/KeyboardAwareScrollView.js`)
- Aware FlatList → Keyboard HOC: wraps FlatList (evidence: `lib/KeyboardAwareFlatList.js`)
- Aware SectionList → Keyboard HOC: wraps SectionList (evidence: `lib/KeyboardAwareSectionList.js`)
- App / TextInput → Aware ScrollView: uses component (evidence: `README.md`)
- App / TextInput → Keyboard HOC: may configure HOC (evidence: `README.md`)
- RN Keyboard events → Keyboard HOC: notifies (evidence: `lib/KeyboardAwareHOC.js`)
- Keyboard HOC → RN scroll / UIManager: measures and scrolls (evidence: `lib/KeyboardAwareHOC.js`)
- Keyboard HOC → Scroll interface: implements (evidence: `lib/KeyboardAwareHOC.js`)
