# gpui-ce/gpui-component architecture

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

## Overview

GPUI Kit is a Rust framework for building desktop applications with GPUI. The principal workflow is an application using the single-crate kit entry point, then composing styled components or building a custom design system on the unstyled base, which supplies behavior and infrastructure over GPUI. Major product branches include editing, data display, dock layouts, rich content, theming, and WebAssembly. The README documents the layer relationships and capabilities; the source index identifies relevant implementation areas, but many feature implementations were not sampled, so feature links are documented capability associations rather than traced call paths.

Main entry points: [`crates/component/src`](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src) (Styled components), [`crates/base/src`](https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src) (Behavior and state), [`crates/kit/src/lib.rs`](https://github.com/gpui-ce/gpui-component/blob/main/crates/kit/src/lib.rs) (Kit facade), [`crates/component/src/input/editor.rs`](https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/input/editor.rs) (Code editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_application(("Rust application"))
  node_kit["Kit facade<br/>[lib.rs]"]
end

subgraph group_layers["UI layers"]
  node_component["Styled components"]
  node_base["Behavior and state"]
end

subgraph group_capabilities["Product capabilities"]
  node_controls["UI controls"]
  node_editor["Code editor<br/>[editor.rs]"]
  node_input_overlay["Editor overlays<br/>[overlay.rs]"]
  node_highlighter["Syntax highlighting"]
  node_data_views["Tables and lists"]
  node_dock["Dock layouts"]
  node_rich_content["Markdown and HTML"]
  node_charts["Charts and plots"]
  node_themes["Themes and tokens"]
  node_notifications["Notifications<br/>[notification.rs]"]
end

subgraph group_runtime["Runtime infrastructure"]
  node_gpui["GPUI runtime"]
  node_wasm["WebAssembly support<br/>[lib.rs]"]
  node_fps["Performance monitoring<br/>[sampler.rs]"]
  node_plot_macro["Plot derive macro"]
end

node_application -->|"depends on"| node_kit
node_kit -->|"re-exports"| node_component
node_kit -->|"re-exports"| node_base
node_component -->|"builds on"| node_base
node_base -->|"uses runtime"| node_gpui
node_component -->|"provides"| node_controls
node_component -->|"provides"| node_editor
node_editor -->|"uses"| node_input_overlay
node_base -->|"supports"| node_highlighter
node_component -->|"provides"| node_data_views
node_base -->|"provides"| node_dock
node_base -->|"provides"| node_rich_content
node_component -->|"provides"| node_charts
node_component -->|"provides"| node_themes
node_component -->|"provides"| node_notifications
node_component -->|"supports"| node_wasm
node_base -.->|"offers monitoring"| node_fps
node_charts -.->|"can derive plots"| node_plot_macro

click node_kit "https://github.com/gpui-ce/gpui-component/blob/main/crates/kit/src/lib.rs"
click node_component "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src"
click node_base "https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src"
click node_controls "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src"
click node_editor "https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/input/editor.rs"
click node_input_overlay "https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/input/overlay.rs"
click node_highlighter "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/highlighter"
click node_data_views "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/table"
click node_dock "https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src/dock/layout"
click node_rich_content "https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src/text/format"
click node_charts "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/chart"
click node_themes "https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/theme"
click node_notifications "https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/notification.rs"
click node_wasm "https://github.com/gpui-ce/gpui-component/blob/main/crates/story-web/src/lib.rs"
click node_fps "https://github.com/gpui-ce/gpui-component/blob/main/crates/fps/src/sampler.rs"
click node_plot_macro "https://github.com/gpui-ce/gpui-component/blob/main/crates/component-macros/src/derive_into_plot.rs"

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_application,node_kit toneBlue
class node_component,node_base toneAmber
class node_controls,node_editor,node_input_overlay,node_highlighter,node_data_views,node_dock,node_rich_content,node_charts,node_themes,node_notifications toneMint
class node_gpui,node_wasm,node_fps,node_plot_macro toneRose
```

## Components

### Application entry

- **Rust application**
- [Kit facade](https://github.com/gpui-ce/gpui-component/blob/main/crates/kit/src/lib.rs): `crates/kit/src/lib.rs`

### UI layers

- [Styled components](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src): `crates/component/src`
- [Behavior and state](https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src): `crates/base/src`

### Product capabilities

- [UI controls](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src): `crates/component/src`
- [Code editor](https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/input/editor.rs): `crates/component/src/input/editor.rs`
- [Editor overlays](https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/input/overlay.rs): `crates/component/src/input/overlay.rs`
- [Syntax highlighting](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/highlighter): `crates/component/src/highlighter`
- [Tables and lists](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/table): `crates/component/src/table`
- [Dock layouts](https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src/dock/layout): `crates/base/src/dock/layout`
- [Markdown and HTML](https://github.com/gpui-ce/gpui-component/tree/main/crates/base/src/text/format): `crates/base/src/text/format`
- [Charts and plots](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/chart): `crates/component/src/chart`
- [Themes and tokens](https://github.com/gpui-ce/gpui-component/tree/main/crates/component/src/theme): `crates/component/src/theme`
- [Notifications](https://github.com/gpui-ce/gpui-component/blob/main/crates/component/src/notification.rs): `crates/component/src/notification.rs`

### Runtime infrastructure

- **GPUI runtime**
- [WebAssembly support](https://github.com/gpui-ce/gpui-component/blob/main/crates/story-web/src/lib.rs): `crates/story-web/src/lib.rs`
- [Performance monitoring](https://github.com/gpui-ce/gpui-component/blob/main/crates/fps/src/sampler.rs): `crates/fps/src/sampler.rs`
- [Plot derive macro](https://github.com/gpui-ce/gpui-component/blob/main/crates/component-macros/src/derive_into_plot.rs): `crates/component-macros/src/derive_into_plot.rs`

## Connections

- Rust application → Kit facade: depends on (evidence: `README.md`)
- Kit facade → Styled components: re-exports (evidence: `README.md`)
- Kit facade → Behavior and state: re-exports (evidence: `README.md`)
- Styled components → Behavior and state: builds on (evidence: `README.md`)
- Behavior and state → GPUI runtime: uses runtime (evidence: `README.md`)
- Styled components → UI controls: provides (evidence: `README.md`)
- Styled components → Code editor: provides (evidence: `README.md`)
- Code editor → Editor overlays: uses (evidence: `crates/component/src/input/overlay.rs`)
- Behavior and state → Syntax highlighting: supports (evidence: `README.md`)
- Styled components → Tables and lists: provides (evidence: `README.md`)
- Behavior and state → Dock layouts: provides (evidence: `README.md`)
- Behavior and state → Markdown and HTML: provides (evidence: `README.md`)
- Styled components → Charts and plots: provides (evidence: `README.md`)
- Styled components → Themes and tokens: provides (evidence: `README.md`)
- Styled components → Notifications: provides (evidence: `README.md`)
- Styled components → WebAssembly support: supports (evidence: `README.md`)
- Behavior and state → Performance monitoring: offers monitoring
- Charts and plots → Plot derive macro: can derive plots
