# oblador/react-native-collapsible architecture

> Architecture diagram of the GitHub repository oblador/react-native-collapsible, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oblador/react-native-collapsible
- Repository: https://github.com/oblador/react-native-collapsible

## Overview

react-native-collapsible is a small React Native UI library. Its primary workflow is to accept a collapsed-state change, measure content when needed, and animate its height; Accordion adds section selection and delegates each section’s visibility to Collapsible. The graph focuses on runtime behavior and the separately documented accordion capability. Source evidence is limited to the provided excerpts and README; no unshown internals are assumed.

Main entry points: [`Collapsible.js`](https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js) (Collapsible view), [`Accordion.js`](https://github.com/oblador/react-native-collapsible/blob/master/Accordion.js) (Accordion sections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accordion["Accordion UI"]
  node_accordion["Accordion sections<br/>[Accordion.js]"]
  node_selection["Section selection<br/>[Accordion.js]"]
end

subgraph group_animation["Collapse Animation"]
  node_collapsible["Collapsible view<br/>[Collapsible.js]"]
  node_measurement["Content measurement<br/>[Collapsible.js]"]
  node_heightanimation["Height animation<br/>[Collapsible.js]"]
end

node_consumer(("App or UI consumer"))
node_reactnative["React Native Animated"]

node_consumer -->|"supplies sections"| node_accordion
node_consumer -->|"sets active sections"| node_selection
node_accordion -->|"handles header taps"| node_selection
node_selection -->|"reports changes"| node_consumer
node_accordion -->|"renders per section"| node_collapsible
node_collapsible -->|"measures content"| node_measurement
node_collapsible -->|"starts transition"| node_heightanimation
node_heightanimation -->|"uses Animated timing"| node_reactnative
node_collapsible -->|"signals animation end"| node_consumer

click node_accordion "https://github.com/oblador/react-native-collapsible/blob/master/Accordion.js"
click node_selection "https://github.com/oblador/react-native-collapsible/blob/master/Accordion.js"
click node_collapsible "https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js"
click node_measurement "https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js"
click node_heightanimation "https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.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_accordion,node_selection,node_consumer toneBlue
class node_collapsible,node_measurement,node_heightanimation toneAmber
class node_reactnative toneIndigo
```

## Components

### Accordion UI

- [Accordion sections](https://github.com/oblador/react-native-collapsible/blob/master/Accordion.js): `Accordion.js`
- [Section selection](https://github.com/oblador/react-native-collapsible/blob/master/Accordion.js): `Accordion.js`

### Collapse Animation

- [Collapsible view](https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js): `Collapsible.js`
- [Content measurement](https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js): `Collapsible.js`
- [Height animation](https://github.com/oblador/react-native-collapsible/blob/master/Collapsible.js): `Collapsible.js`

### Other components

- **App or UI consumer**
- **React Native Animated**

## Connections

- App or UI consumer → Accordion sections: supplies sections (evidence: `README.md`)
- App or UI consumer → Section selection: sets active sections (evidence: `README.md`)
- Accordion sections → Section selection: handles header taps (evidence: `Accordion.js`)
- Section selection → App or UI consumer: reports changes (evidence: `Accordion.js`)
- Accordion sections → Collapsible view: renders per section (evidence: `Accordion.js`)
- Collapsible view → Content measurement: measures content (evidence: `Collapsible.js`)
- Collapsible view → Height animation: starts transition (evidence: `Collapsible.js`)
- Height animation → React Native Animated: uses Animated timing (evidence: `Collapsible.js`)
- Collapsible view → App or UI consumer: signals animation end (evidence: `Collapsible.js`)
