Files
Jonathan Kelley cd54f5953b update the dioxus cratesio readme, add many more examples (#5501)
* update the dioxus cratesio readme

* fix example

* fix header

* add a bunch more examples
2026-04-21 17:07:48 -07:00

24 lines
658 B
Rust

//! Setting a favicon.
//!
//! Use `document::Link` with `rel: "icon"` to point the browser at a favicon. Combined with
//! `asset!`, the favicon is bundled into the app and served with the same path-mangling
//! and cache-busting as any other asset.
use dioxus::prelude::*;
const FAVICON: Asset = asset!("/examples/assets/logo.png");
fn main() {
dioxus::launch(app);
}
fn app() -> Element {
rsx! {
// Link is a generic head element — for a favicon set rel="icon"
document::Link { rel: "icon", href: FAVICON }
h1 { "Check the browser tab!" }
p { "The favicon is loaded from examples/assets/logo.png." }
}
}