# nyskyfox/moderndesign architecture

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

## Overview

ModernDesign is a native C++ Fluent Design controls framework with an application shell and Direct2D rendering. Its intended workflow is to initialize a window and rendering context, deliver input and frame callbacks to an application, and draw themed controls. The graph includes documented control families and shared rendering, theme, geometry, animation, and icon layers. The tree and excerpts do not show a demo entry point or how applications compose controls, so those links are omitted.

Main entry points: [`src/core/Renderer.cpp`](https://github.com/nyskyfox/moderndesign/blob/main/src/core/Renderer.cpp) (Direct2D renderer), [`src/core/Theme.cpp`](https://github.com/nyskyfox/moderndesign/blob/main/src/core/Theme.cpp) (Theme tokens), [`src/utils/FluentIcons.cpp`](https://github.com/nyskyfox/moderndesign/blob/main/src/utils/FluentIcons.cpp) (Fluent vector icons), [`src/controls/Expander.cpp`](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/Expander.cpp) (Expander)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app_shell["Window and frame loop<br/>[App.cpp]"]
end

subgraph group_controls["Fluent controls"]
  node_buttons["Buttons and selection<br/>[Button.cpp]"]
  node_toggles["Toggle controls<br/>[ToggleSwitch.cpp]"]
  node_navigation["Navigation view<br/>[NavigationView.cpp]"]
  node_menus["Menus and flyouts<br/>[MenuFlyout.cpp]"]
  node_dialogs["Content dialogs<br/>[ContentDialog.cpp]"]
  node_expander["Expander<br/>[Expander.cpp]"]
  node_cards["Cards and settings<br/>[SettingsCard.cpp]"]
  node_tooltips["Tooltips<br/>[ToolTip.cpp]"]
  node_progress["Progress indicators<br/>[ProgressBar.cpp]"]
end

subgraph group_rendering["Rendering and theme"]
  node_renderer["Direct2D renderer<br/>[Renderer.cpp]"]
  node_theme["Theme tokens<br/>[Theme.cpp]"]
end

subgraph group_shared["Shared primitives"]
  node_icons["Fluent vector icons<br/>[FluentIcons.cpp]"]
  node_icon_data["Icon path data<br/>[FluentIconsData.h]"]
  node_easing["Animation easing<br/>[Easing.h]"]
  node_geometry["DIP geometry<br/>[Geometry.h]"]
  node_color["Color utilities<br/>[Color.h]"]
end

node_app_shell -->|"inherits and renders"| node_renderer
node_app_shell -->|"sets theme"| node_theme
node_app_shell -->|"uses icons"| node_icons
node_renderer -->|"uses tokens"| node_theme
node_buttons -->|"draws with"| node_renderer
node_buttons -->|"reads tokens"| node_theme
node_toggles -->|"draws with"| node_renderer
node_toggles -->|"reads tokens"| node_theme
node_navigation -->|"draws with"| node_renderer
node_navigation -->|"reads tokens"| node_theme
node_navigation -->|"animates with"| node_easing
node_menus -->|"draws with"| node_renderer
node_menus -->|"reads tokens"| node_theme
node_menus -->|"animates with"| node_easing
node_dialogs -->|"draws with"| node_renderer
node_dialogs -->|"reads tokens"| node_theme
node_dialogs -->|"uses buttons"| node_buttons
node_expander -->|"draws with"| node_renderer
node_expander -->|"reads tokens"| node_theme
node_expander -->|"animates with"| node_easing
node_expander -->|"draws icons"| node_icons
node_cards -->|"draws with"| node_renderer
node_cards -->|"reads tokens"| node_theme
node_cards -->|"draws icons"| node_icons
node_tooltips -->|"draws with"| node_renderer
node_tooltips -->|"reads tokens"| node_theme
node_progress -.->|"uses renderer"| node_renderer
node_icons -->|"draws paths"| node_renderer
node_icons -->|"loads paths"| node_icon_data
node_renderer -->|"uses geometry"| node_geometry
node_theme -->|"uses geometry"| node_geometry
node_icons -->|"uses colors"| node_color

click node_app_shell "https://github.com/nyskyfox/moderndesign/blob/main/src/app/App.cpp"
click node_renderer "https://github.com/nyskyfox/moderndesign/blob/main/src/core/Renderer.cpp"
click node_theme "https://github.com/nyskyfox/moderndesign/blob/main/src/core/Theme.cpp"
click node_buttons "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/Button.cpp"
click node_toggles "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ToggleSwitch.cpp"
click node_navigation "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/NavigationView.cpp"
click node_menus "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/MenuFlyout.cpp"
click node_dialogs "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ContentDialog.cpp"
click node_expander "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/Expander.cpp"
click node_cards "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/SettingsCard.cpp"
click node_tooltips "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ToolTip.cpp"
click node_progress "https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ProgressBar.cpp"
click node_icons "https://github.com/nyskyfox/moderndesign/blob/main/src/utils/FluentIcons.cpp"
click node_icon_data "https://github.com/nyskyfox/moderndesign/blob/main/src/utils/FluentIconsData.h"
click node_easing "https://github.com/nyskyfox/moderndesign/blob/main/src/utils/Easing.h"
click node_geometry "https://github.com/nyskyfox/moderndesign/blob/main/src/Geometry.h"
click node_color "https://github.com/nyskyfox/moderndesign/blob/main/src/utils/Color.h"

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_app_shell toneBlue
class node_buttons,node_toggles,node_navigation,node_menus,node_dialogs,node_expander,node_cards,node_tooltips,node_progress toneAmber
class node_renderer,node_theme toneMint
class node_icons,node_icon_data,node_easing,node_geometry,node_color toneRose
```

## Components

### Application shell

- [Window and frame loop](https://github.com/nyskyfox/moderndesign/blob/main/src/app/App.cpp): `src/app/App.cpp`

### Fluent controls

- [Buttons and selection](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/Button.cpp): `src/controls/Button.cpp`
- [Toggle controls](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ToggleSwitch.cpp): `src/controls/ToggleSwitch.cpp`
- [Navigation view](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/NavigationView.cpp): `src/controls/NavigationView.cpp`
- [Menus and flyouts](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/MenuFlyout.cpp): `src/controls/MenuFlyout.cpp`
- [Content dialogs](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ContentDialog.cpp): `src/controls/ContentDialog.cpp`
- [Expander](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/Expander.cpp): `src/controls/Expander.cpp`
- [Cards and settings](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/SettingsCard.cpp): `src/controls/SettingsCard.cpp`
- [Tooltips](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ToolTip.cpp): `src/controls/ToolTip.cpp`
- [Progress indicators](https://github.com/nyskyfox/moderndesign/blob/main/src/controls/ProgressBar.cpp): `src/controls/ProgressBar.cpp`

### Rendering and theme

- [Direct2D renderer](https://github.com/nyskyfox/moderndesign/blob/main/src/core/Renderer.cpp): `src/core/Renderer.cpp`
- [Theme tokens](https://github.com/nyskyfox/moderndesign/blob/main/src/core/Theme.cpp): `src/core/Theme.cpp`

### Shared primitives

- [Fluent vector icons](https://github.com/nyskyfox/moderndesign/blob/main/src/utils/FluentIcons.cpp): `src/utils/FluentIcons.cpp`
- [Icon path data](https://github.com/nyskyfox/moderndesign/blob/main/src/utils/FluentIconsData.h): `src/utils/FluentIconsData.h`
- [Animation easing](https://github.com/nyskyfox/moderndesign/blob/main/src/utils/Easing.h): `src/utils/Easing.h`
- [DIP geometry](https://github.com/nyskyfox/moderndesign/blob/main/src/Geometry.h): `src/Geometry.h`
- [Color utilities](https://github.com/nyskyfox/moderndesign/blob/main/src/utils/Color.h): `src/utils/Color.h`

## Connections

- Window and frame loop → Direct2D renderer: inherits and renders
- Window and frame loop → Theme tokens: sets theme (evidence: `src/app/App.cpp`)
- Window and frame loop → Fluent vector icons: uses icons (evidence: `src/app/App.cpp`)
- Direct2D renderer → Theme tokens: uses tokens
- Buttons and selection → Direct2D renderer: draws with (evidence: `src/controls/Button.cpp`)
- Buttons and selection → Theme tokens: reads tokens (evidence: `src/controls/Button.cpp`)
- Toggle controls → Direct2D renderer: draws with (evidence: `src/controls/ToggleSwitch.cpp`)
- Toggle controls → Theme tokens: reads tokens (evidence: `src/controls/ToggleSwitch.cpp`)
- Navigation view → Direct2D renderer: draws with (evidence: `src/controls/NavigationView.cpp`)
- Navigation view → Theme tokens: reads tokens (evidence: `src/controls/NavigationView.cpp`)
- Navigation view → Animation easing: animates with (evidence: `src/controls/NavigationView.cpp`)
- Menus and flyouts → Direct2D renderer: draws with (evidence: `src/controls/MenuFlyout.cpp`)
- Menus and flyouts → Theme tokens: reads tokens (evidence: `src/controls/MenuFlyout.cpp`)
- Menus and flyouts → Animation easing: animates with (evidence: `src/controls/MenuFlyout.cpp`)
- Content dialogs → Direct2D renderer: draws with (evidence: `src/controls/ContentDialog.cpp`)
- Content dialogs → Theme tokens: reads tokens (evidence: `src/controls/ContentDialog.cpp`)
- Content dialogs → Buttons and selection: uses buttons (evidence: `src/controls/ContentDialog.cpp`)
- Expander → Direct2D renderer: draws with (evidence: `src/controls/Expander.cpp`)
- Expander → Theme tokens: reads tokens (evidence: `src/controls/Expander.cpp`)
- Expander → Animation easing: animates with (evidence: `src/controls/Expander.cpp`)
- Expander → Fluent vector icons: draws icons (evidence: `src/controls/Expander.cpp`)
- Cards and settings → Direct2D renderer: draws with (evidence: `src/controls/SettingsCard.cpp`)
- Cards and settings → Theme tokens: reads tokens (evidence: `src/controls/SettingsCard.cpp`)
- Cards and settings → Fluent vector icons: draws icons (evidence: `src/controls/SettingsCard.cpp`)
- Tooltips → Direct2D renderer: draws with (evidence: `src/controls/ToolTip.cpp`)
- Tooltips → Theme tokens: reads tokens (evidence: `src/controls/ToolTip.cpp`)
- Progress indicators → Direct2D renderer: uses renderer
- Fluent vector icons → Direct2D renderer: draws paths (evidence: `src/utils/FluentIcons.cpp`)
- Fluent vector icons → Icon path data: loads paths (evidence: `src/utils/FluentIcons.cpp`)
- Direct2D renderer → DIP geometry: uses geometry
- Theme tokens → DIP geometry: uses geometry
- Fluent vector icons → Color utilities: uses colors
