You build a Dioxus frontend by creating a new Cargo project, adding the dioxus dependency, and defining a main function that renders a component using launch.
-
Create a new project and add the Dioxus dependency.
cargo new my_app && cd my_app && cargo add dioxus -
Replace the contents of
src/main.rswith a basic Dioxus application entry point. `use dioxus::prelude::*;
fn main() { launch(app); }
fn app() -> Element { rsx! { div { "Hello, Dioxus!" } } } `
- Run the application in your browser.
cargo run