leptos-material 0.6.1

A Leptos component wrapper for Material Web Components.
1
2
3
4
5
6
7
8
9
10
11
12
13
use leptos::{component, view, IntoView, ReadSignal};

/// Icon element. See [Material Symbols](https://fonts.google.com/icons) for icon options.
/// Icon names are `snake_case`.
#[component]
pub fn Icon(
    /// Icon name. See [Material Symbols](https://fonts.google.com/icons) for icon options.
    #[prop(into)]
    name: String,
    #[prop(optional, into)] element_slot: String,
) -> impl IntoView {
    view! { <md-icon slot=element_slot>{name}</md-icon> }
}