pub fn dyn_class(&self, class: impl ToString, apply: ReadSignal<bool>) -> &Self {
        let class = class.to_string();
        let element = self.element.clone();

        create_effect(move || {
            let apply = apply.get();

            if *apply {
                element.add_class(class.as_ref());
            } else {
                element.remove_class(class.as_ref());
            }
        });

        self
    }
/// Adds a dynamic class on the node.
///
/// If `value` is `None`, the attribute will be completely removed
/// from the node.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: GenericNode>() -> View<G> {
/// let checked_class = Signal::new(false);
///
/// input()
///     .attr("type", "checkbox")
///     .dyn_class("bg-red-500", checked_class.handle())
///     .build()
/// }
/// ```
Adds a dynamic class on the node.
If `value` is `None`, the attribute will be completely removed
from the node.
Adds a dynamic class on the node . If ` value ` is ` None ` the attribute will be completely removed from the node .
pub fn dyn_class(&self, class: impl ToString, apply: ReadSignal<bool>) -> &Self {
        let class = class.to_string();
        let element = self.element.clone();
        create_effect(move || {
            let apply = apply.get();
            if *apply {
                element.add_class(class.as_ref());
            } else {
                element.remove_class(class.as_ref());
            }
        });
        self
    }
pub fn dyn_class ( & self , class : impl ToString , apply : ReadSignal < bool > ) -> & Self { let class = class . to_string ( ) ; let element = self . element . clone ( ) ; create_effect ( move | | { let apply = apply . get ( ) ; if * apply { element . add_class ( class . as_ref ( ) ) ; } else { element . remove_class ( class . as_ref ( ) ) ; } } ) ; self }
Adds a dynamic class on the node.
Adds a dynamic class on the node .
&self
class
impl ToString
apply
ReadSignal<bool>
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
let checked_class = Signal::new(false).


let checked_class = Signal :: new ( false ) .