# peterstaev/nativescript-drop-down architecture

> Architecture diagram of the GitHub repository peterstaev/nativescript-drop-down, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/peterstaev/nativescript-drop-down
- Repository: https://github.com/peterstaev/nativescript-drop-down

## Overview

NativeScript DropDown is a cross-platform selection widget: an app supplies items and a selection, the platform implementation presents a native picker, and selection/open/close events return to the app. Shared code defines item and property semantics; separate iOS and Android implementations adapt them to native controls, with an Angular module for element registration and form binding. The platform files are excerpted only partially, so the graph limits implementation details to the shown calls and documented behavior.

Main entry points: [`drop-down.ios.ts`](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.ios.ts) (iOS picker widget), [`drop-down.android.ts`](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.android.ts) (Android spinner widget), [`drop-down-common.ts`](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down-common.ts) (Shared API and items), [`angular/index.ts`](https://github.com/peterstaev/nativescript-drop-down/blob/master/angular/index.ts) (Angular module and accessor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared widget"]
  node_common["Shared API and items"]
end

subgraph group_native["Native platforms"]
  node_ios["iOS picker widget<br/>[drop-down.ios.ts]"]
  node_android["Android spinner widget"]
end

subgraph group_angular["Angular integration"]
  node_angular["Angular module and accessor<br/>[index.ts]"]
end

node_app(("NativeScript app"))
node_iosnative["UILabel and picker"]
node_androidnative["Android Spinner"]

node_app -->|"sets items"| node_common
node_ios -->|"extends shared API"| node_common
node_android -->|"extends shared API"| node_common
node_ios -->|"wraps native views"| node_iosnative
node_android -->|"wraps Spinner"| node_androidnative
node_app -->|"uses widget"| node_ios
node_app -->|"uses widget"| node_android
node_angular -->|"registers element"| node_app
node_app -->|"binds selected index"| node_angular

click node_common "https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down-common.ts"
click node_ios "https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.ios.ts"
click node_android "https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.android.ts"
click node_angular "https://github.com/peterstaev/nativescript-drop-down/blob/master/angular/index.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_common toneBlue
class node_ios,node_android toneAmber
class node_angular toneMint
class node_app,node_iosnative,node_androidnative toneIndigo
```

## Components

### Shared widget

- [Shared API and items](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down-common.ts): `drop-down-common.ts`

### Native platforms

- [iOS picker widget](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.ios.ts): `drop-down.ios.ts`
- [Android spinner widget](https://github.com/peterstaev/nativescript-drop-down/blob/master/drop-down.android.ts): `drop-down.android.ts`

### Angular integration

- [Angular module and accessor](https://github.com/peterstaev/nativescript-drop-down/blob/master/angular/index.ts): `angular/index.ts`

### Other components

- **NativeScript app**
- **UILabel and picker**
- **Android Spinner**

## Connections

- NativeScript app → Shared API and items: sets items (evidence: `README.md`)
- iOS picker widget → Shared API and items: extends shared API (evidence: `drop-down.ios.ts`)
- Android spinner widget → Shared API and items: extends shared API (evidence: `drop-down.android.ts`)
- iOS picker widget → UILabel and picker: wraps native views (evidence: `README.md`)
- Android spinner widget → Android Spinner: wraps Spinner (evidence: `README.md`)
- NativeScript app → iOS picker widget: uses widget (evidence: `README.md`)
- NativeScript app → Android spinner widget: uses widget (evidence: `README.md`)
- Angular module and accessor → NativeScript app: registers element (evidence: `angular/index.ts`)
- NativeScript app → Angular module and accessor: binds selected index (evidence: `README.md`)
