Thanks for Element Plus for providing the icons.
Make sure your Cargo.toml includes the Dioxus dependency:
[dependencies]
dioxus = "0.6"cargo add dxc-iconsSince 'Box' is a keyword in Rust, please use 'IconBox'.
'Document' is a keyword in Dioxus, please use 'IconDocument'.
For a better experience, it can be used in conjunction with dxc - our UI component library.
-
Github: https://github.com/efahnjoe/dxc
-
Crate: https://crates.io/crates/dxc
| Name | Type | Description | Default |
|---|---|---|---|
| size | Option<&'static str> |
Icon size | "1rem" |
| color | Option<&'static str> |
Svg fill color | "currentColor" |
use dioxus::prelude::*;
use dxc_icons::{Plus, IconBox};
#[component]
fn App() -> Element {
Div {
Plus {}
IconBox {}
IconDocument {}
}
}rsx! {
Div {
Plus {
size: "16px", // The size of the icon: size * size
color: "black", // The svg fill color
}
}
}Make sure you have dioxus installed globally.
dx serve --example icons --platform web -- --no-default-features