Crate dioxus_mobile

source ·
Expand description

Dioxus Mobile MIT licensed Build Status Discord chat

Website | Guides | API Docs | Chat


dioxus-mobile is a re-export of dioxus-desktop with some minor tweaks and documentation changes. As this crate evolves, it will provide some more unique features to mobile, but for now, it’s very similar to the desktop crate.

Dioxus Mobile supports both iOS and Android. However, Android support is still quite experimental and requires a lot of configuration. A good area to contribute here would be to improve the CLI tool to include bundling and mobile configuration.

Getting Set up

Getting set up with mobile can but quite challenging. The tooling here isn’t great (yet) and might take some hacking around to get things working. macOS M1 is broadly unexplored and might not work for you.

We’re going to be using cargo-mobile to build for mobile. First, install it:

$ cargo install --git

And then initialize your app for the right platform. Use the winit template for now. Right now, there’s no “Dioxus” template in cargo-mobile.

$ cargo mobile init

We’re going to completely clear out the dependencies it generates for us, swapping out winit with dioxus-mobile.

name = "dioxus-ios-demo"
version = "0.1.0"
authors = ["Jonathan Kelley <>"]
edition = "2018"

# leave the `lib` declaration
crate-type = ["staticlib", "cdylib", "rlib"]

# leave the binary it generates for us
name = "dioxus-ios-demo-desktop"
path = "gen/bin/"

# clear all the dependencies
mobile-entry-point = "0.1.0"
dioxus = { version = "*", features = ["mobile"] }
simple_logger = "*"

Edit your

use dioxus::prelude::*;

fn main() {

fn app(cx: Scope) -> Element {
        div {
            "hello world!"

To configure the webview, menubar, and other important desktop-specific features, checkout out some of the launch configuration in the API reference.

Future Steps

Make sure to read the Dioxus Guide if you already haven’t!


  • Report issues on our issue tracker.
  • Join the discord and ask questions!


This project is licensed under the MIT license.

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


Wry is a Cross-platform WebView rendering library.


The configuration for the desktop application.
An imperative interface to the current window.
A future that resolves to the result of a JavaScript evaluation.
A size represented in logical pixels.
A size represented in physical pixels.
Object that allows you to build windows.


Launch the WebView and run the event loop.
Launch the WebView and run the event loop, with configuration.
Launch the WebView and run the event loop, with configuration and root props.
Get a closure that executes any JavaScript in the WebView context.
Get an imperative handle to the current window