dioxus README

The project's README from github.com/DioxusLabs/dioxus. As one markdown file: README.md.


Crates.io version Download docs.rs docs CI status Awesome Page Discord Link

Website | Examples | Tutorial | 中文 | PT-BR | 日本語 | Türkçe | 한국어



Build for web, desktop, and mobile, and more with a single codebase. Zero-config setup, integrated hot-reloading, and signals-based state management. Add backend functionality with Server Functions and bundle with our CLI.

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!" }
    }
}

⭐️ Unique features:

Instant hot-reloading

With one command, dx serve and your app is running. Edit your markup, styles, and see changes in milliseconds. Use our experimental dx serve --hotpatch to update Rust code in real time.

Build Beautiful Apps

Dioxus apps are styled with HTML and CSS. Use the built-in TailwindCSS support or load your favorite CSS library. Easily call into native code (objective-c, JNI, Web-Sys) for a perfect native touch.

Truly fullstack applications

Dioxus deeply integrates with axum to provide powerful fullstack capabilities for both clients and servers. Pick from a wide array of built-in batteries like WebSockets, SSE, Streaming, File Upload/Download, Server-Side-Rendering, Forms, Middleware, and Hot-Reload, or go fully custom and integrate your existing axum backend.

Experimental Native Renderer

Render using web-sys, webview, server-side-rendering, liveview, or even with our experimental WGPU-based renderer. Embed Dioxus in Bevy, WGPU, or even run on embedded Linux!

First-party primitive components

Get started quickly with a complete set of primitives modeled after shadcn/ui and Radix-Primitives.

First-class Android and iOS support

Dioxus is the fastest way to build native mobile apps with Rust. Simply run dx serve --platform android and your app is running in an emulator or on device in seconds. Call directly into JNI and Native APIs.

Bundle for web, desktop, and mobile

Simply run dx bundle and your app will be built and bundled with maximization optimizations. On the web, take advantage of .avif generation, .wasm compression, minification, and more. Build WebApps weighing less than 50kb and desktop/mobile apps less than 5mb.

Fantastic documentation

We've put a ton of effort into building clean, readable, and comprehensive documentation. All html elements and listeners are documented with MDN docs, and our Docs runs continuous integration with Dioxus itself to ensure that the docs are always up to date. Check out the Dioxus website for guides, references, recipes, and more. Fun fact: we use the Dioxus website as a testbed for new Dioxus features - check it out!

Community

Dioxus is a community-driven project, with a very active Discord and GitHub community. We're always looking for help, and we're happy to answer questions and help you get started. Our SDK is community-run and we even have a GitHub organization for the best Dioxus crates that receive free upgrades and support.

Full-time core team

Dioxus has grown from a side project to a small team of fulltime engineers. Thanks to the generous support of FutureWei, Satellite.im, the GitHub Accelerator program, we're able to work on Dioxus full-time. Our long term goal is for Dioxus to become self-sustaining by providing paid high-quality enterprise tools. If your company is interested in adopting Dioxus and would like to work with us, please reach out!

Supported Platforms

Web
  • Render directly to the DOM using WebAssembly
  • Pre-render with SSR and rehydrate on the client
  • Simple "hello world" at about 50kb, comparable to React
  • Built-in dev server and hot reloading for quick iteration
Desktop
  • Render using Webview or - experimentally - with WGPU or Freya (Skia)
  • Zero-config setup. Simply `cargo run` or `dx serve` to build your app
  • Full support for native system access without IPC
  • Supports macOS, Linux, and Windows. Portable <3mb binaries
Mobile
  • Render using Webview or - experimentally - with WGPU or Skia
  • Build .ipa and .apk files for iOS and Android
  • Call directly into Java and Objective-C with minimal overhead
  • From "hello world" to running on device in seconds
Server-side Rendering
  • Suspense, hydration, and server-side rendering
  • Quickly drop in backend functionality with server functions
  • Extractors, middleware, and routing integrations
  • Static-site generation and incremental regeneration

Running the examples

The examples in the main branch of this repository target the git version of dioxus and the CLI. If you are looking for examples that work with the latest stable release of dioxus, check out the 0.6 branch.

The examples in the top level of this repository can be run with:

cargo run --example <example>

However, we encourage you to download the dioxus-cli to test out features like hot-reloading. To install the most recent binary CLI, you can use cargo binstall.

curl -fsSL https://dioxuslabs.com/install.sh | bash

If this CLI is out-of-date, you can install it directly from git or cargo-binstall

cargo install --git https://github.com/DioxusLabs/dioxus dioxus-cli --locked

With the CLI, you can also run examples with the web platform. You will need to disable the default desktop feature and enable the web feature with this command:

dx serve --example <example> --platform web -- --no-default-features

Contributing

License

This project is licensed under either the MIT license or the Apache-2 License.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you, shall be licensed as MIT or Apache-2, without any additional terms or conditions.

dioxus (DioxusLabs/dioxus)

ssr
Searching Database…

39.4K ·GitHub
What is this?Dioxus is a Rust framework for building apps with one codebase that run on web, desktop, mobile, and server.
Is it a framework or a library?It is a fullstack UI framework with its own CLI, bundler, and renderer, not just a component library.
How do I get it running?Install the dioxus-cli, then run 'dx serve' to start the dev server with hot-reloading; use 'dx bundle' to package the final app.
Do I need the Dioxus CLI to develop with it?Yes, the CLI (dx) is needed for hot-reloading and running examples; you can install it via cargo binstall or directly from git.
Are the native WGPU renderer and Rust hot-patching stable yet?No, the WGPU/Skia renderer and the 'dx serve --hotpatch' Rust hot-patching are explicitly marked experimental.
Which platforms does it actually target?Web (WASM/DOM), desktop (macOS, Linux, Windows via Webview), and mobile (iOS and Android via Webview), plus server-side rendering.
How does state management work?Dioxus uses a signals-based reactive state system, combining ideas from React, Solid, and Svelte for ergonomic updates.
Can I reuse existing styling tools?Yes, apps are styled with plain HTML/CSS and have built-in TailwindCSS support, or you can bring your own CSS library.
How small are the resulting app bundles?Web apps can be bundled under 50kb and desktop/mobile apps under 5mb thanks to the integrated optimizing bundler.
Does it integrate with an existing backend?Yes, it deeply integrates with the axum web framework, offering WebSockets, SSE, streaming, file upload, SSR, forms, and middleware out of the box.
Creator
DioxusLabs
Size
56.3 MB
Stars
39.4K
Age
5y
Commits · 90 Days