# epifanovmd/anchor-list architecture

> Architecture diagram of the GitHub repository epifanovmd/anchor-list, 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/epifanovmd/anchor-list
- Repository: https://github.com/epifanovmd/anchor-list

## Overview

AnchorList is a virtualized React Native list that preserves the visible row by key as content changes. The principal flow is consumer configuration into the list component and runtime, which computes visible items and coordinates scrolling, measurement, and layout; rendered containers then display the selected rows. Separate capabilities cover sticky anchors, edge-triggered loading, keyboard/end insets, viewability, public state hooks, diagnostics, and performance reporting. The graph follows the README and available import references; several internal feature modules were not sampled, so their runtime links are documented or left out rather than inferred.

Main entry points: [`src/components/AnchorList.tsx`](https://github.com/epifanovmd/anchor-list/blob/main/src/components/AnchorList.tsx) (AnchorList API), [`src/core/runtime/list-runtime.ts`](https://github.com/epifanovmd/anchor-list/blob/main/src/core/runtime/list-runtime.ts) (List runtime), [`src/index.ts`](https://github.com/epifanovmd/anchor-list/blob/main/src/index.ts) (Public exports), [`src/perf/list-perf.ts`](https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf.ts) (Performance tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Public interface"]
  node_anchorlist["AnchorList API<br/>[AnchorList.tsx]"]
  node_public["Public exports<br/>[index.ts]"]
  node_hooks["State hooks"]
end

subgraph group_render["Rendering and state"]
  node_model[("List store<br/>[list-store.ts]")]
  node_containers["Container binding"]
  node_listcontainers["Visible containers<br/>[ListContainers.tsx]"]
  node_itemcontainer["Item container"]
  node_axis["Axis layout<br/>[axis.ts]"]
  node_slots["List slots<br/>[list-slots.ts]"]
end

subgraph group_engine["List engine"]
  node_runtime["List runtime<br/>[list-runtime.ts]"]
  node_metrics["Item metrics<br/>[list-metrics.ts]"]
end

subgraph group_features["List features"]
  node_scrollhandler["Scroll handler"]
  node_scrolladjust["Scroll adjustment"]
  node_offset["Item offsets<br/>[item-offset.ts]"]
  node_mvcp["Position preservation<br/>[mvcp.ts]"]
  node_edges["Edge loading<br/>[edge-thresholds.ts]"]
  node_sticky["Sticky anchors"]
  node_stickyplacement["Sticky placement"]
  node_inset["End inset<br/>[useInsetEnd.ts]"]
  node_viewability["Item visibility<br/>[viewability.ts]"]
end

subgraph group_observe["Diagnostics and metrics"]
  node_debug["Debug channels<br/>[debug-channel.ts]"]
  node_debugregistry["Debug registry<br/>[debug-registry.ts]"]
  node_debugformat["Debug formatting<br/>[debug-format.ts]"]
  node_perf["Performance tracking<br/>[list-perf.ts]"]
  node_framemonitor["Frame monitor<br/>[frame-monitor.ts]"]
  node_perfmetrics["Performance metrics"]
  node_perfreport["Performance report"]
end

node_consumer(("App developer"))

node_consumer -->|"configures"| node_anchorlist
node_anchorlist -->|"updates runtime"| node_runtime
node_anchorlist -->|"renders"| node_listcontainers
node_anchorlist -->|"uses inset hook"| node_inset
node_anchorlist -->|"publishes values"| node_hooks
node_anchorlist -->|"applies edge inset"| node_stickyplacement
node_listcontainers -->|"renders items"| node_itemcontainer
node_listcontainers -->|"styles slots"| node_axis
node_anchorlist -->|"renders slots"| node_slots
node_runtime -->|"updates state"| node_model
node_runtime -.->|"uses metrics"| node_metrics
node_runtime -->|"binds containers"| node_containers
node_containers -->|"positions items"| node_metrics
node_anchorlist -->|"renders adjustment"| node_scrolladjust
node_runtime -->|"captures position"| node_mvcp
node_mvcp -.->|"resolves item offset"| node_offset
node_scrollhandler -->|"reports scrolling"| node_runtime
node_runtime -->|"checks thresholds"| node_edges
node_anchorlist -->|"renders overlay"| node_sticky
node_anchorlist -.->|"handles scrolling"| node_scrollhandler
node_runtime -.->|"tracks visibility"| node_viewability
node_public -->|"exports"| node_anchorlist
node_public -->|"exports hooks"| node_hooks
node_public -->|"exports diagnostics"| node_debugregistry
node_debug -->|"formats events"| node_debugformat
node_debug -->|"registers channels"| node_debugregistry
node_runtime -->|"logs events"| node_debug
node_public -->|"exports tracking"| node_perf
node_perf -->|"monitors frames"| node_framemonitor
node_perf -->|"collects metrics"| node_perfmetrics
node_perf -->|"builds reports"| node_perfreport

click node_anchorlist "https://github.com/epifanovmd/anchor-list/blob/main/src/components/AnchorList.tsx"
click node_public "https://github.com/epifanovmd/anchor-list/blob/main/src/index.ts"
click node_runtime "https://github.com/epifanovmd/anchor-list/blob/main/src/core/runtime/list-runtime.ts"
click node_model "https://github.com/epifanovmd/anchor-list/blob/main/src/model/list-store.ts"
click node_metrics "https://github.com/epifanovmd/anchor-list/blob/main/src/model/metrics/list-metrics.ts"
click node_containers "https://github.com/epifanovmd/anchor-list/blob/main/src/core/layout/container-binder.ts"
click node_listcontainers "https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListContainers.tsx"
click node_itemcontainer "https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListItemContainer.tsx"
click node_axis "https://github.com/epifanovmd/anchor-list/blob/main/src/components/axis.ts"
click node_slots "https://github.com/epifanovmd/anchor-list/blob/main/src/components/list-slots.ts"
click node_scrollhandler "https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useListScrollHandler.ts"
click node_scrolladjust "https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListScrollAdjust.tsx"
click node_offset "https://github.com/epifanovmd/anchor-list/blob/main/src/core/scroll/item-offset.ts"
click node_mvcp "https://github.com/epifanovmd/anchor-list/blob/main/src/core/mvcp/mvcp.ts"
click node_edges "https://github.com/epifanovmd/anchor-list/blob/main/src/core/edges/edge-thresholds.ts"
click node_sticky "https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListStickyOverlay.tsx"
click node_stickyplacement "https://github.com/epifanovmd/anchor-list/blob/main/src/components/sticky-placement.ts"
click node_inset "https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useInsetEnd.ts"
click node_viewability "https://github.com/epifanovmd/anchor-list/blob/main/src/core/viewability/viewability.ts"
click node_hooks "https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useListSharedValues.ts"
click node_debug "https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-channel.ts"
click node_debugregistry "https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-registry.ts"
click node_debugformat "https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-format.ts"
click node_perf "https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf.ts"
click node_framemonitor "https://github.com/epifanovmd/anchor-list/blob/main/src/perf/frame-monitor.ts"
click node_perfmetrics "https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf-metrics.ts"
click node_perfreport "https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf-report.ts"

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_anchorlist,node_public,node_hooks toneBlue
class node_model,node_containers,node_listcontainers,node_itemcontainer,node_axis,node_slots toneAmber
class node_runtime,node_metrics toneMint
class node_scrollhandler,node_scrolladjust,node_offset,node_mvcp,node_edges,node_sticky,node_stickyplacement,node_inset,node_viewability toneRose
class node_debug,node_debugregistry,node_debugformat,node_perf,node_framemonitor,node_perfmetrics,node_perfreport,node_consumer toneIndigo
```

## Components

### Public interface

- [AnchorList API](https://github.com/epifanovmd/anchor-list/blob/main/src/components/AnchorList.tsx): `src/components/AnchorList.tsx`
- [Public exports](https://github.com/epifanovmd/anchor-list/blob/main/src/index.ts): `src/index.ts`
- [State hooks](https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useListSharedValues.ts): `src/hooks/useListSharedValues.ts`

### Rendering and state

- [List store](https://github.com/epifanovmd/anchor-list/blob/main/src/model/list-store.ts): `src/model/list-store.ts`
- [Container binding](https://github.com/epifanovmd/anchor-list/blob/main/src/core/layout/container-binder.ts): `src/core/layout/container-binder.ts`
- [Visible containers](https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListContainers.tsx): `src/components/ListContainers.tsx`
- [Item container](https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListItemContainer.tsx): `src/components/ListItemContainer.tsx`
- [Axis layout](https://github.com/epifanovmd/anchor-list/blob/main/src/components/axis.ts): `src/components/axis.ts`
- [List slots](https://github.com/epifanovmd/anchor-list/blob/main/src/components/list-slots.ts): `src/components/list-slots.ts`

### List engine

- [List runtime](https://github.com/epifanovmd/anchor-list/blob/main/src/core/runtime/list-runtime.ts): `src/core/runtime/list-runtime.ts`
- [Item metrics](https://github.com/epifanovmd/anchor-list/blob/main/src/model/metrics/list-metrics.ts): `src/model/metrics/list-metrics.ts`

### List features

- [Scroll handler](https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useListScrollHandler.ts): `src/hooks/useListScrollHandler.ts`
- [Scroll adjustment](https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListScrollAdjust.tsx): `src/components/ListScrollAdjust.tsx`
- [Item offsets](https://github.com/epifanovmd/anchor-list/blob/main/src/core/scroll/item-offset.ts): `src/core/scroll/item-offset.ts`
- [Position preservation](https://github.com/epifanovmd/anchor-list/blob/main/src/core/mvcp/mvcp.ts): `src/core/mvcp/mvcp.ts`
- [Edge loading](https://github.com/epifanovmd/anchor-list/blob/main/src/core/edges/edge-thresholds.ts): `src/core/edges/edge-thresholds.ts`
- [Sticky anchors](https://github.com/epifanovmd/anchor-list/blob/main/src/components/ListStickyOverlay.tsx): `src/components/ListStickyOverlay.tsx`
- [Sticky placement](https://github.com/epifanovmd/anchor-list/blob/main/src/components/sticky-placement.ts): `src/components/sticky-placement.ts`
- [End inset](https://github.com/epifanovmd/anchor-list/blob/main/src/hooks/useInsetEnd.ts): `src/hooks/useInsetEnd.ts`
- [Item visibility](https://github.com/epifanovmd/anchor-list/blob/main/src/core/viewability/viewability.ts): `src/core/viewability/viewability.ts`

### Diagnostics and metrics

- [Debug channels](https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-channel.ts): `src/debug/debug-channel.ts`
- [Debug registry](https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-registry.ts): `src/debug/debug-registry.ts`
- [Debug formatting](https://github.com/epifanovmd/anchor-list/blob/main/src/debug/debug-format.ts): `src/debug/debug-format.ts`
- [Performance tracking](https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf.ts): `src/perf/list-perf.ts`
- [Frame monitor](https://github.com/epifanovmd/anchor-list/blob/main/src/perf/frame-monitor.ts): `src/perf/frame-monitor.ts`
- [Performance metrics](https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf-metrics.ts): `src/perf/list-perf-metrics.ts`
- [Performance report](https://github.com/epifanovmd/anchor-list/blob/main/src/perf/list-perf-report.ts): `src/perf/list-perf-report.ts`

### Other components

- **App developer**

## Connections

- App developer → AnchorList API: configures (evidence: `README.md`)
- AnchorList API → List runtime: updates runtime (evidence: `src/components/AnchorList.tsx`)
- AnchorList API → Visible containers: renders (evidence: `src/components/AnchorList.tsx`)
- AnchorList API → End inset: uses inset hook (evidence: `src/components/AnchorList.tsx`)
- AnchorList API → State hooks: publishes values (evidence: `src/components/AnchorList.tsx`)
- AnchorList API → Sticky placement: applies edge inset (evidence: `src/components/AnchorList.tsx`)
- Visible containers → Item container: renders items (evidence: `src/components/ListContainers.tsx`)
- Visible containers → Axis layout: styles slots (evidence: `src/components/ListContainers.tsx`)
- AnchorList API → List slots: renders slots (evidence: `src/components/AnchorList.tsx`)
- List runtime → List store: updates state (evidence: `src/core/runtime/list-runtime.ts`)
- List runtime → Item metrics: uses metrics
- List runtime → Container binding: binds containers (evidence: `src/core/runtime/list-runtime.ts`)
- Container binding → Item metrics: positions items (evidence: `src/core/layout/container-binder.ts`)
- AnchorList API → Scroll adjustment: renders adjustment (evidence: `src/components/AnchorList.tsx`)
- List runtime → Position preservation: captures position (evidence: `src/core/runtime/list-runtime.ts`)
- Position preservation → Item offsets: resolves item offset
- Scroll handler → List runtime: reports scrolling (evidence: `src/hooks/useListScrollHandler.ts`)
- List runtime → Edge loading: checks thresholds (evidence: `src/core/runtime/list-runtime.ts`)
- AnchorList API → Sticky anchors: renders overlay (evidence: `src/components/AnchorList.tsx`)
- AnchorList API → Scroll handler: handles scrolling
- List runtime → Item visibility: tracks visibility
- Public exports → AnchorList API: exports (evidence: `src/index.ts`)
- Public exports → State hooks: exports hooks (evidence: `src/index.ts`)
- Public exports → Debug registry: exports diagnostics (evidence: `src/index.ts`)
- Debug channels → Debug formatting: formats events (evidence: `src/debug/debug-channel.ts`)
- Debug channels → Debug registry: registers channels (evidence: `src/debug/debug-channel.ts`)
- List runtime → Debug channels: logs events (evidence: `src/core/runtime/list-runtime.ts`)
- Public exports → Performance tracking: exports tracking (evidence: `src/index.ts`)
- Performance tracking → Frame monitor: monitors frames (evidence: `src/perf/list-perf.ts`)
- Performance tracking → Performance metrics: collects metrics (evidence: `src/perf/list-perf.ts`)
- Performance tracking → Performance report: builds reports (evidence: `src/perf/list-perf.ts`)
