Dioxus
Audited from github.com/DioxusLabs/dioxus
Dioxus is a Rust app framework for web, desktop and mobile from one codebase: React-like rsx! components with signals, a virtual DOM with several renderers, axum-based fullstack server functions and the dx CLI.
- Language
- Rust
- License
- Apache-2.0
- Running for
- 5 years
- Team
- 6-20 people
Why this architecture
Dioxus keeps one virtual DOM and component model and swaps renderers per platform (WebAssembly, WebView, SSR, LiveView, native), while its own dx CLI handles hot-patching, asset bundling and packaging for every target.
Tech stack by layer
8 technologies · audited Oct 2, 2026- DioxusReact-like component framework with rsx! markup and signals; workspace version 0.8 alpha on the audited main branch.
- WebAssemblyWeb renderer targets the browser through wasm-bindgen, web-sys and js-sys; wasm-split supports code splitting.
- wry / taoDesktop renderer: dioxus-desktop draws into the OS WebView via wry and manages windows with tao.
- Native rendererExperimental packages/native and native-dom crates render without a WebView, described in the README as WGPU-based.
- dx CLIdioxus-cli builds, serves, hot-reloads, hot-patches and bundles apps for web, desktop and mobile.
- GitHub Actionsmain.yml runs CI and publish.yml publishes releases.
- PlaywrightEnd-to-end tests in packages/playwright-tests; the devcontainer preinstalls Playwright browsers.
- Nixflake.nix and flake.lock provide a reproducible development environment.
- AGENTS.mdRoot-level instructions for coding agents working in the repository.
Key architectural decisions
5 decisions- 01
One component model, many renderers
The workspace keeps the virtual DOM in packages/core and ships separate renderer crates: packages/web (WebAssembly), packages/desktop (wry WebView), packages/ssr, packages/liveview and the experimental packages/native and native-dom, so the same rsx! components target browser, desktop, mobile and server.
- 02
The CLI is part of the framework, not an add-on
packages/cli (dioxus-cli, the dx command) depends on the rsx parser, autoformatter, hot-reload and subsecond crates and runs its own Axum dev server with WebSockets and tower-http, so building, serving, hot-patching and bundling for every platform share one tool.
- 03
Subsecond hot-patching of Rust code
packages/subsecond is a workspace crate that packages/core and packages/cli both depend on. The README describes "subsecond Rust hot-patching" through dx serve --hotpatch, which updates running Rust code without a full rebuild, alongside rsx and asset hot-reloading from packages/rsx-hotreload.
- 04
Fullstack split into core, macro and server crates
packages/fullstack, fullstack-core, fullstack-macro and fullstack-server are separate members, and the README states that Dioxus integrates deeply with axum and offers WebSockets, SSE, streaming, file upload, SSR and forms, or lets an existing axum backend be plugged in.
- 05
Assets resolved at compile time with manganis
packages/manganis and packages/asset-resolver handle assets: the resolver has separate web (web-sys fetch) and native (file system, Android NDK) backends, and const-serialize lets asset metadata be computed in const contexts so the CLI can bundle and optimise assets.
How Dioxus is built
How Dioxus is structured
Dioxus is a large Cargo workspace under packages/. The root Cargo.toml lists the members and sets a shared version (0.8.0-alpha.1 on the audited main branch). The README and docs links refer to the released 0.7 line.
| Area | Crates in packages/ |
|---|---|
| Core | core (virtual DOM), core-macro, core-template, core-types, generational-box, signals, stores, hooks |
| Markup | rsx, rsx-hotreload, rsx-rosetta (HTML to rsx), autofmt, html, document |
| Renderers | web, desktop, ssr, liveview, native, native-dom, interpreter |
| Fullstack | fullstack, fullstack-core, fullstack-macro, fullstack-server |
| App libraries | router, router-macro, history, logger |
| Tooling | cli (dx), cli-config, cli-telemetry, cli-harnesses/*, devtools, subsecond, wasm-split, manganis, asset-resolver |
| Testing | playwright-tests, fuzz, oracle |
examples/ is organised as a numbered curriculum: 01-app-demos, 02-building-ui, through 07-fullstack, 08-apis, 09-reference and 10-integrations. notes/ holds the architecture notes, FAQ, release process and README translations.
Frontend
Components are functions returning Element, written with the rsx! macro and state from use_signal. The README's counter shows the shape. packages/core diffs component output and emits mutations, and each renderer applies them in its own way:
- Web: WebAssembly via
wasm-bindgen,web-sysandjs-sys.wasm-splitsupports splitting the bundle. - Desktop:
dioxus-desktoprenders into the OS WebView withwryand manages windows withtao. A binary protocol indioxus-interpreter-jscarries DOM edits. - Mobile: the README documents
dx serve --platform android.asset-resolverpulls injniandndkcrates on Android. - SSR and LiveView:
packages/ssrrenders HTML strings, andpackages/liveviewdrives the DOM from the server. - Native (experimental):
packages/nativeandnative-domrender without a WebView. The README describes this as a WGPU-based renderer.
Backend & APIs
The fullstack crates provide server functions and server rendering on Axum. The README lists WebSockets, SSE, streaming, file upload and download, forms and middleware, and says an existing Axum backend can be plugged in instead. The dx CLI also runs an Axum server of its own during development (axum, axum-server, tower-http and tokio-tungstenite in packages/cli/Cargo.toml) to serve builds and push hot-reload updates.
Build, test & deploy
dx serveruns an app with rsx and asset hot-reloading.dx serve --hotpatchusessubsecondto patch running Rust code.dx bundlepackages for web, macOS, Linux, Windows and mobile..github/workflows/main.ymlruns CI andpublish.ymlpublishes releases.codecov.ymlconfigures coverage,_typos.tomlspell-checks, andlychee.tomlchecks links..devcontainer/Dockerfilestarts from a nightly Rust image and installs WebKitGTK, GTK and Playwright browsers for desktop and end-to-end tests.flake.nixoffers a Nix shell.packages/fuzzandpackages/oracleadd fuzzing and differential testing of the core.- Crates use Rust edition 2024. The CLI requires Rust 1.93 and core crates 1.85.
What to copy (and what not to)
Copy:
- A renderer-agnostic core that emits mutations, with thin per-platform renderers. That is what makes one component tree run everywhere.
- Ship the CLI with the framework. Hot reload, hot patching and bundling stay in step with the runtime.
- A numbered examples curriculum (
01-…10-) that doubles as a learning path. - Fuzzing the core (
packages/fuzz) when correctness of diffing matters.
Don't copy blindly:
- Dozens of crates and several renderers are a large surface to keep compatible. A single-platform app should not split itself this finely.
maincarries a 0.8 alpha. Applications should depend on released versions.
For web-only, SSR-first apps, compare with Leptos. For a desktop shell with a JavaScript UI and Rust commands, see the Tauri + React rules.
Sources & repo audit
- Audited
- Oct 2, 2026
- Commit
- b2ed8c3
- License
- Apache-2.0
- Workspace Cargo.toml (members, version)
- packages/cli/Cargo.toml (dx CLI)
- packages/desktop/Cargo.toml (wry/tao renderer)
- packages/core/Cargo.toml
- README (features, fullstack, renderers)
Independent analysis of repository at github.com/DioxusLabs/dioxus. Spotted an inaccuracy? Use the claim form to request a correction.
Maintainer? Add the architecture badge to your README
[](https://stackitfast.com/project/dioxus) Scaffold it with your agent
Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Dioxus's architecture.
- 1Copy the promptThe full markdown spec, with every layer and decision.
- 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
- 3Paste and scaffoldUse it as the first instruction; review before you ship.
# MISSION: Scaffold "Dioxus" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Dioxus**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Dioxus
- **What It Does**: Dioxus is a Rust app framework for web, desktop and mobile from one codebase: React-like rsx! components with signals, a virtual DOM with several renderers, axum-based fullstack server functions and the dx CLI.
- **Domain & Category**: Cross-Platform Rust App Framework
- **Production Scale**: 6-20 people
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Dioxus keeps one virtual DOM and component model and swaps renderers per platform (WebAssembly, WebView, SSR, LiveView, native), while its own dx CLI handles hot-patching, asset bundling and packaging for every target.
- **Live Website Reference**: https://dioxuslabs.com
- **Source Repository**: https://github.com/DioxusLabs/dioxus
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Rust, Dioxus, WebAssembly, Axum, Tokio, Playwright, Nix, GitHub Actions
- **Primary Language(s)**: Rust, HTML, JavaScript, TypeScript
- **License of the reference repo**: Apache-2.0
- **Frontend**: Dioxus — React-like component framework with rsx! markup and signals; workspace version 0.8 alpha on the audited main branch.; WebAssembly — Web renderer targets the browser through wasm-bindgen, web-sys and js-sys; wasm-split supports code splitting.; wry / tao — Desktop renderer: dioxus-desktop draws into the OS WebView via wry and manages windows with tao.; Native renderer — Experimental packages/native and native-dom crates render without a WebView, described in the README as WGPU-based.
- **Backend & APIs**: Axum — Fullstack server integration; the README says Dioxus integrates with axum for server functions, SSR, WebSockets and SSE.; Tokio — Async runtime for the CLI dev server, desktop renderer and fullstack server.
- **Infrastructure & deploy**: dx CLI — dioxus-cli builds, serves, hot-reloads, hot-patches and bundles apps for web, desktop and mobile.; GitHub Actions — main.yml runs CI and publish.yml publishes releases.; Playwright — End-to-end tests in packages/playwright-tests; the devcontainer preinstalls Playwright browsers.; Nix — flake.nix and flake.lock provide a reproducible development environment.
- **Tooling, testing & ops**: AGENTS.md — Root-level instructions for coding agents working in the repository.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/DioxusLabs/dioxus @ b2ed8c3)
1. **One component model, many renderers**: The workspace keeps the virtual DOM in packages/core and ships separate renderer crates: packages/web (WebAssembly), packages/desktop (wry WebView), packages/ssr, packages/liveview and the experimental packages/native and native-dom, so the same rsx! components target browser, desktop, mobile and server.
2. **The CLI is part of the framework, not an add-on**: packages/cli (dioxus-cli, the dx command) depends on the rsx parser, autoformatter, hot-reload and subsecond crates and runs its own Axum dev server with WebSockets and tower-http, so building, serving, hot-patching and bundling for every platform share one tool.
3. **Subsecond hot-patching of Rust code**: packages/subsecond is a workspace crate that packages/core and packages/cli both depend on. The README describes "subsecond Rust hot-patching" through dx serve --hotpatch, which updates running Rust code without a full rebuild, alongside rsx and asset hot-reloading from packages/rsx-hotreload.
4. **Fullstack split into core, macro and server crates**: packages/fullstack, fullstack-core, fullstack-macro and fullstack-server are separate members, and the README states that Dioxus integrates deeply with axum and offers WebSockets, SSE, streaming, file upload, SSR and forms, or lets an existing axum backend be plugged in.
5. **Assets resolved at compile time with manganis**: packages/manganis and packages/asset-resolver handle assets: the resolver has separate web (web-sys fetch) and native (file system, Android NDK) backends, and const-serialize lets asset metadata be computed in const contexts so the CLI can bundle and optimise assets.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
- Structure as a Turborepo monorepo with strict package boundaries:
- `apps/web`: Application UI, routing, layouts, and server endpoints.
- `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
- `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
- `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
- Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
- Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
- Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
- Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
- Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
- Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
- Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer: client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.Frequently asked about Dioxus
What is Dioxus?
Dioxus is a Rust framework for building web, desktop and mobile apps from one codebase. Components are written with the rsx! macro and signals, rendered by a virtual DOM in packages/core, and shipped with the dx CLI.
Does Dioxus use a virtual DOM?
Yes. packages/core implements a virtual DOM that diffs component output and hands mutations to a renderer: WebAssembly in the browser, a WebView on desktop, HTML for SSR, LiveView over a socket, or an experimental native renderer.
Dioxus or Leptos?
Dioxus targets web, desktop and mobile from one component model and ships its own CLI and bundler. Leptos focuses on web apps with fine-grained reactivity and SSR with hydration. Pick Dioxus for cross-platform apps and Leptos for web-only, SSR-first apps.
Does Dioxus have a backend?
Yes. The fullstack crates add server functions and server-side rendering on top of axum, with WebSockets, SSE, streaming and file uploads, and an existing axum backend can be integrated instead.
How does Dioxus render on desktop?
dioxus-desktop renders into the operating system WebView through the wry crate and manages windows with tao, the same libraries Tauri uses. An experimental native renderer in packages/native draws without a WebView.
One email a month: new deep dives and stack trends
New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.
Similar architectures
- AxumClassicRust Web Framework · 1M+ MAUShares Rust · Axum · Tokio
- LeptosClassicFull-Stack Rust Web Framework · 6-20 peopleShares Rust · WebAssembly · Axum
- Actix WebClassicRust Web Framework · 1M+ MAUShares Rust · Tokio · GitHub Actions
- crates.ioClassicPackage Registry · 1M+ MAUShares Rust · Axum · Tokio
- DenoClassicSecure JavaScript & TypeScript Runtime · 20+ peopleShares Rust · Tokio
- LocoClassicRails-Style Rust Web Framework · 2-5 peopleShares Rust · Axum · Tokio