This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on

Macro yew::macros::classes

source ·
classes!() { /* proc-macro */ }
Expand description

This macro provides a convenient way to create Classes.

The macro takes a list of items similar to the vec! macro and returns a Classes instance. Each item can be of any type that implements Into<Classes> (See the implementations on Classes to learn what types can be used).


let conditional_class = Some("my-other-class");
let vec_of_classes = vec![

html! {
    <div class={classes!("my-container-class", conditional_class, vec_of_classes)}>
        // ...