dioxus/packages/desktop/src
Jonathan Kelley 3fb1f739d1
Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975)
* simplify cli-config crate
* clean up configs
* add devtools crate, update cargo imports
* fix serve addr, fix websocket proxy issue
* add comment about opt profiles
* rename hot-reload to devtools
2024-09-17 17:18:23 -07:00
..
assets fix: Update logos and custom assets example (#960) 2023-04-15 08:02:04 -05:00
app.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00
assets.rs Hotreloading of for/if/body, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258) 2024-07-17 19:11:18 -07:00
config.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00
desktop_context.rs Synchronous prevent default (#2792) 2024-08-13 11:57:54 -07:00
document.rs Fix playwright tests (#2695) 2024-07-24 12:48:30 -07:00
edits.rs Synchronous prevent default (#2792) 2024-08-13 11:57:54 -07:00
element.rs Add access to the Element attributes related to scrolling (#2338) 2024-05-21 12:56:49 -05:00
event_handlers.rs Fix non tokio builds for desktop 2024-01-18 04:07:28 -08:00
events.rs Add the onresize event handler to Element (#2479) 2024-08-15 01:23:49 +00:00
file_upload.rs feat (desktop): upgrade from wry 37 to 41 (#2618) 2024-07-10 12:50:04 -07:00
hooks.rs Make use_callback and Callback bring the runtime with them (#2852) 2024-08-20 14:58:53 -07:00
index.html Clean up and document the protocol handler 2024-01-04 19:52:49 -08:00
ipc.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00
launch.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00
lib.rs Pre-release 0.6.0-alpha.0 (#2755) 2024-07-31 22:37:39 -05:00
menubar.rs Implement the "Toggle Developer Tools" menu item in desktop (#2198) 2024-04-02 10:53:26 -07:00
mobile_shortcut.rs clippy, and don't hash invisible files for ts generation 2024-03-05 22:38:38 -08:00
protocol.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00
query.rs Refactor and fix eval channels (#2302) 2024-04-26 11:55:48 -04:00
readme.md update 0.4 doc links to 0.5 2024-03-27 20:42:07 -05:00
shortcut.rs fix most typos, add crate-ci/typos to CI (#2653) 2024-07-23 17:49:33 -07:00
waker.rs clippy, and don't hash invisible files for ts generation 2024-03-05 22:38:38 -08:00
webview.rs Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975) 2024-09-17 17:18:23 -07:00

Dioxus Desktop Renderer

Render the Dioxus VirtualDom using the platform's native WebView implementation.

Desktop

One of Dioxus' flagship features is the ability to quickly build a native desktop app that looks and feels the same across platforms. Apps built with Dioxus are typically <5mb in size and use existing system resources, so they won't hog extreme amounts of RAM or memory.

Dioxus Desktop is built off Tauri. Right now there aren't any Dioxus abstractions over the menubar, handling, etc, so you'll want to leverage Tauri - mostly Wry and Tao directly. An upcoming release of Dioxus-Desktop will include components and hooks for notifications, global shortcuts, menubar, etc.

Getting Set up

Getting Set up with Dioxus-Desktop is quite easy. Make sure you have Rust and Cargo installed, and then create a new project:

$ cargo new --bin demo
$ cd app

Add Dioxus and the desktop renderer feature:

$ cargo add dioxus
$ cargo add dioxus-desktop

Edit your main.rs:

// main.rs
use dioxus::prelude::*;

fn main() {
    dioxus_desktop::launch(app);
}

fn app() -> Element {
    rsx!{
        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!