# fyne-io/fyne architecture

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

- Interactive diagram: https://gitdiagram.com/fyne-io/fyne
- Repository: https://github.com/fyne-io/fyne

## Overview

Fyne is a Go UI toolkit and app API for building desktop and mobile applications from one codebase. The main workflow is an app developer creating an app and window, assembling widgets into containers, then showing the UI through a platform driver. Internally, canvas objects are rendered by painter implementations. The README also documents storage, themes, and the fyne utility for packaging and release. Some subsystem paths are known only from the tree; links to their runtime callers are omitted where the excerpts do not establish them.

Main entry points: [`app/app.go`](https://github.com/fyne-io/fyne/blob/develop/app/app.go) (App API), [`driver/driver.go`](https://github.com/fyne-io/fyne/blob/develop/driver/driver.go) (Platform drivers), [`canvas/image.go`](https://github.com/fyne-io/fyne/blob/develop/canvas/image.go) (Canvas objects), [`window.go`](https://github.com/fyne-io/fyne/blob/develop/window.go) (Window API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["App and UI API"]
  node_appapi["App API<br/>[app.go]"]
  node_window["Window API<br/>[window.go]"]
end

subgraph group_presentation["Widgets and presentation"]
  node_widget["Widgets<br/>[widget.go]"]
  node_entry["Text entry<br/>[entry.go]"]
  node_containers["Containers and tabs<br/>[tabs.go]"]
  node_layouts["Layouts<br/>[boxlayout.go]"]
  node_canvas["Canvas objects<br/>[image.go]"]
  node_theme["Themes and icons<br/>[icons.go]"]
  node_dialogs["Dialogs<br/>[dialog.go]"]
end

subgraph group_runtime["Rendering and platform runtime"]
  node_driver["Platform drivers<br/>[driver.go]"]
  node_desktop["Desktop runtime<br/>[driver.go]"]
  node_mobile["Mobile runtime<br/>[app.go]"]
  node_painter["Painter<br/>[draw.go]"]
  node_software["Software renderer<br/>[draw.go]"]
  node_svg["SVG renderer<br/>[svg.go]"]
end

subgraph group_services["Data and app services"]
  node_binding["Data binding<br/>[trees.go]"]
  node_storage["Storage API<br/>[uri.go]"]
  node_repository[("Resource repositories<br/>[memory.go]")]
  node_preferences[("Preferences<br/>[preferences.go]")]
end

subgraph group_tooling["App packaging utility"]
  node_cli["fyne utility<br/>[main.go]"]
  node_commands["App commands<br/>[package.go]"]
end

node_developer(("App developer"))
node_platform(("Desktop or mobile OS"))

node_developer -->|"creates app"| node_appapi
node_appapi -->|"creates window"| node_window
node_developer -->|"assembles UI"| node_widget
node_developer -->|"arranges content"| node_containers
node_developer -->|"sets content"| node_window
node_window -.->|"shows UI"| node_driver
node_appapi -->|"creates window"| node_driver
node_widget -.->|"draws as"| node_canvas
node_containers -->|"hosts content"| node_widget
node_entry -->|"binds data"| node_binding
node_canvas -->|"renders SVG"| node_svg
node_painter -->|"draws objects"| node_canvas
node_desktop -.->|"runs on"| node_platform
node_mobile -.->|"runs on"| node_platform
node_driver -.->|"selects platform"| node_desktop
node_driver -.->|"selects platform"| node_mobile
node_software -.->|"renders objects"| node_canvas
node_theme -->|"uses SVG"| node_svg
node_appapi -->|"registers repository"| node_repository
node_appapi -->|"initializes storage"| node_storage
node_storage -->|"uses URI repository"| node_repository
node_developer -->|"packages app"| node_cli
node_cli -->|"registers commands"| node_commands

click node_appapi "https://github.com/fyne-io/fyne/blob/develop/app/app.go"
click node_window "https://github.com/fyne-io/fyne/blob/develop/window.go"
click node_widget "https://github.com/fyne-io/fyne/blob/develop/widget/widget.go"
click node_entry "https://github.com/fyne-io/fyne/blob/develop/widget/entry.go"
click node_containers "https://github.com/fyne-io/fyne/blob/develop/container/tabs.go"
click node_layouts "https://github.com/fyne-io/fyne/blob/develop/layout/boxlayout.go"
click node_canvas "https://github.com/fyne-io/fyne/blob/develop/canvas/image.go"
click node_theme "https://github.com/fyne-io/fyne/blob/develop/theme/icons.go"
click node_dialogs "https://github.com/fyne-io/fyne/blob/develop/dialog/dialog.go"
click node_driver "https://github.com/fyne-io/fyne/blob/develop/driver/driver.go"
click node_desktop "https://github.com/fyne-io/fyne/blob/develop/internal/driver/glfw/driver.go"
click node_mobile "https://github.com/fyne-io/fyne/blob/develop/internal/driver/mobile/app/app.go"
click node_painter "https://github.com/fyne-io/fyne/blob/develop/internal/painter/draw.go"
click node_software "https://github.com/fyne-io/fyne/blob/develop/internal/painter/software/draw.go"
click node_svg "https://github.com/fyne-io/fyne/blob/develop/internal/svg/svg.go"
click node_binding "https://github.com/fyne-io/fyne/blob/develop/data/binding/trees.go"
click node_storage "https://github.com/fyne-io/fyne/blob/develop/storage/uri.go"
click node_repository "https://github.com/fyne-io/fyne/blob/develop/internal/repository/memory.go"
click node_preferences "https://github.com/fyne-io/fyne/blob/develop/internal/preferences.go"
click node_cli "https://github.com/fyne-io/fyne/blob/develop/cmd/fyne/main.go"
click node_commands "https://github.com/fyne-io/fyne/blob/develop/cmd/fyne/internal/commands/package.go"

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_appapi,node_window toneBlue
class node_widget,node_entry,node_containers,node_layouts,node_canvas,node_theme,node_dialogs toneAmber
class node_driver,node_desktop,node_mobile,node_painter,node_software,node_svg toneMint
class node_binding,node_storage,node_repository,node_preferences toneRose
class node_cli,node_commands,node_developer,node_platform toneIndigo
```

## Components

### App and UI API

- [App API](https://github.com/fyne-io/fyne/blob/develop/app/app.go): `app/app.go`
- [Window API](https://github.com/fyne-io/fyne/blob/develop/window.go): `window.go`

### Widgets and presentation

- [Widgets](https://github.com/fyne-io/fyne/blob/develop/widget/widget.go): `widget/widget.go`
- [Text entry](https://github.com/fyne-io/fyne/blob/develop/widget/entry.go): `widget/entry.go`
- [Containers and tabs](https://github.com/fyne-io/fyne/blob/develop/container/tabs.go): `container/tabs.go`
- [Layouts](https://github.com/fyne-io/fyne/blob/develop/layout/boxlayout.go): `layout/boxlayout.go`
- [Canvas objects](https://github.com/fyne-io/fyne/blob/develop/canvas/image.go): `canvas/image.go`
- [Themes and icons](https://github.com/fyne-io/fyne/blob/develop/theme/icons.go): `theme/icons.go`
- [Dialogs](https://github.com/fyne-io/fyne/blob/develop/dialog/dialog.go): `dialog/dialog.go`

### Rendering and platform runtime

- [Platform drivers](https://github.com/fyne-io/fyne/blob/develop/driver/driver.go): `driver/driver.go`
- [Desktop runtime](https://github.com/fyne-io/fyne/blob/develop/internal/driver/glfw/driver.go): `internal/driver/glfw/driver.go`
- [Mobile runtime](https://github.com/fyne-io/fyne/blob/develop/internal/driver/mobile/app/app.go): `internal/driver/mobile/app/app.go`
- [Painter](https://github.com/fyne-io/fyne/blob/develop/internal/painter/draw.go): `internal/painter/draw.go`
- [Software renderer](https://github.com/fyne-io/fyne/blob/develop/internal/painter/software/draw.go): `internal/painter/software/draw.go`
- [SVG renderer](https://github.com/fyne-io/fyne/blob/develop/internal/svg/svg.go): `internal/svg/svg.go`

### Data and app services

- [Data binding](https://github.com/fyne-io/fyne/blob/develop/data/binding/trees.go): `data/binding/trees.go`
- [Storage API](https://github.com/fyne-io/fyne/blob/develop/storage/uri.go): `storage/uri.go`
- [Resource repositories](https://github.com/fyne-io/fyne/blob/develop/internal/repository/memory.go): `internal/repository/memory.go`
- [Preferences](https://github.com/fyne-io/fyne/blob/develop/internal/preferences.go): `internal/preferences.go`

### App packaging utility

- [fyne utility](https://github.com/fyne-io/fyne/blob/develop/cmd/fyne/main.go): `cmd/fyne/main.go`
- [App commands](https://github.com/fyne-io/fyne/blob/develop/cmd/fyne/internal/commands/package.go): `cmd/fyne/internal/commands/package.go`

### Other components

- **App developer**
- **Desktop or mobile OS**

## Connections

- App developer → App API: creates app
- App API → Window API: creates window
- App developer → Widgets: assembles UI
- App developer → Containers and tabs: arranges content
- App developer → Window API: sets content
- Window API → Platform drivers: shows UI
- App API → Platform drivers: creates window (evidence: `app/app.go`)
- Widgets → Canvas objects: draws as
- Containers and tabs → Widgets: hosts content (evidence: `container/tabs.go`)
- Text entry → Data binding: binds data (evidence: `widget/entry.go`)
- Canvas objects → SVG renderer: renders SVG (evidence: `canvas/image.go`)
- Painter → Canvas objects: draws objects (evidence: `internal/painter/draw.go`)
- Desktop runtime → Desktop or mobile OS: runs on
- Mobile runtime → Desktop or mobile OS: runs on
- Platform drivers → Desktop runtime: selects platform
- Platform drivers → Mobile runtime: selects platform
- Software renderer → Canvas objects: renders objects
- Themes and icons → SVG renderer: uses SVG (evidence: `theme/icons.go`)
- App API → Resource repositories: registers repository (evidence: `app/app.go`)
- App API → Storage API: initializes storage (evidence: `app/app.go`)
- Storage API → Resource repositories: uses URI repository (evidence: `storage/uri.go`)
- App developer → fyne utility: packages app
- fyne utility → App commands: registers commands (evidence: `cmd/fyne/main.go`)
