material_yew/
icon.rs

1use wasm_bindgen::prelude::*;
2use yew::prelude::*;
3
4#[wasm_bindgen(module = "/build/mwc-icon.js")]
5extern "C" {
6    #[derive(Debug)]
7    type Icon;
8
9    #[wasm_bindgen(getter, static_method_of = Icon)]
10    fn _dummy_loader() -> JsValue;
11}
12
13loader_hack!(Icon);
14
15/// Props for [`MatIcon`]
16///
17/// [MWC Documentation for properties](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/icon#propertiesattributes)
18#[derive(Debug, Properties, PartialEq, Clone)]
19pub struct IconProps {
20    pub children: Children,
21}
22
23component!(
24    MatIcon,
25    IconProps,
26    |props: &IconProps| {
27        html! {
28             <mwc-icon>{props.children.clone()}</mwc-icon>
29        }
30    },
31    Icon,
32    "icon"
33);