Dioxus: Fullstack App Framework for Web, Desktop, and Mobile
Summary
Dioxus is a powerful fullstack application framework built in Rust, enabling developers to create performant applications for web, desktop, and mobile from a single codebase. It offers zero-config setup, integrated hot-reloading, and signals-based state management, making cross-platform development efficient and enjoyable. With Dioxus, you can build truly cross-platform experiences with ease and efficiency.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Dioxus is an innovative fullstack application framework written in Rust, designed to empower developers to build robust and performant applications across various platforms. With over 31,000 stars on GitHub, it allows you to target web, desktop, and mobile environments using a single, unified codebase, streamlining development and ensuring consistency. It emphasizes a zero-config setup, integrated hot-reloading for rapid iteration, and an ergonomic signals-based state management system, providing a modern and efficient development experience.
Installation
To get started with Dioxus, you'll typically install its command-line interface (CLI). The recommended way to install the most recent binary CLI is using cargo binstall:
cargo binstall dioxus-cli@0.7.0 --force
If the binstall version is out-of-date, you can install it directly from the Git repository:
cargo install --git https://github.com/DioxusLabs/dioxus dioxus-cli --locked
Make sure you have Rust and Cargo installed on your system.
Examples
Dioxus uses a declarative UI syntax similar to React. Here's a simple counter application example:
fn app() -> Element {
let mut count = use_signal(|| 0);
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
}
}
You can run examples with the Dioxus CLI. For instance, to run a web example, you might use:
dx serve --example <example_name> --platform web -- --no-default-features
More examples are available in the Dioxus examples directory.
Why Use Dioxus
Dioxus stands out with several compelling features that make it an excellent choice for modern application development:
- Cross-Platform Development: Build for web, desktop (macOS, Linux, Windows), mobile (Android, iOS), and even server-side rendering from a single Rust codebase.
- Ergonomic State Management: It combines the best patterns from frameworks like React, Solid, and Svelte, offering a powerful and intuitive signals-based state management system.
- Fullstack Capabilities: Deeply integrates with
axumto provide robust fullstack features, including WebSockets, SSE, streaming, file handling, and server-side rendering. - Rapid Development Cycle: Features subsecond Rust hot-patching and asset hot-reloading, significantly speeding up the development process.
- Optimized Bundling: The integrated bundler ensures highly optimized deployments, generating small
.wasmfiles for web and compact binaries for desktop and mobile. - Comprehensive Documentation: Dioxus offers extensive, clear, and continuously updated documentation, including guides, references, and tutorials.
- Active Community and Core Team: Supported by a vibrant community on Discord and GitHub, alongside a dedicated full-time core team committed to its growth and enterprise-grade tools.
Links
- GitHub Repository: DioxusLabs/dioxus
- Official Website: dioxuslabs.com
- Documentation: docs.rs/dioxus
- Discord Community: Dioxus Discord
- Examples: Dioxus Examples