pub fn dyn_bool_attr<N>(&self, name: N, value: ReadSignal<bool>) -> &Self
    where
        N: ToString,
    {
        let element = self.element.clone();

        let name = name.to_string();

        cloned!((name) => create_effect(move || {
            let v = value.get();

            if *v {
                element.set_attribute(name.as_ref(), "");
            } else {
                element.remove_attribute(name.as_ref());
            }
        }));

        self
    }
/// Adds a dynamic boolean attribute on the node.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: GenericNode>() -> View<G> {
/// let required = Signal::new(true);
///
/// input()
///     .dyn_bool_attr("required", required.handle()).build()
/// }
/// ```
Adds a dynamic boolean attribute on the node.
Adds a dynamic boolean attribute on the node .
pub fn dyn_bool_attr<N>(&self, name: N, value: ReadSignal<bool>) -> &Self
    where
        N: ToString,
    {
        let element = self.element.clone();
        let name = name.to_string();
        cloned!((name) => create_effect(move || {
            let v = value.get();
            if *v {
                element.set_attribute(name.as_ref(), "");
            } else {
                element.remove_attribute(name.as_ref());
            }
        }));
        self
    }
pub fn dyn_bool_attr < N > ( & self , name : N , value : ReadSignal < bool > ) -> & Self where N : ToString , { let element = self . element . clone ( ) ; let name = name . to_string ( ) ; cloned ! ( ( name ) create_effect ( move { let v value get ( ) if v { element set_attribute ( name as_ref ( ) " " ) } else { element remove_attribute ( name as_ref ( ) ) } } ) ) ; self }
Adds a dynamic boolean attribute on the node.
Adds a dynamic boolean attribute on the node .
&self
name
N
value
ReadSignal<bool>
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
let required = Signal::new(true).

input()
.dyn_bool_attr("required", required.handle()).build()
}
```
let required = Signal :: new ( true ) . input () . dyn_bool_attr ( " required " required . handle () ) . build () } ` ` `