#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_material_icons::{MaterialIcon, MaterialIconStylesheet, MaterialIconVariant};
fn main() {
dioxus_desktop::launch(App);
}
fn App(cx: Scope) -> Element {
let is_blue = use_state(&cx, || false);
cx.render(rsx!(
MaterialIconStylesheet {
variant: MaterialIconVariant::SelfHosted("examples/assets/MaterialIcons-Regular.ttf")
}
button {
style: "padding: 10",
onclick: move |_| is_blue.set(!is_blue),
if *is_blue.get() {
rsx!(MaterialIcon { name: "home", color: "blue".into() })
} else {
rsx!(MaterialIcon { name: "home" })
}
}
))
}