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

        let name = name.to_string();

        create_effect(move || {
            let v = value.get();

            if let Some(v) = &*v {
                element.set_attribute(name.as_ref(), v.to_string().as_ref());
            } else {
                element.remove_attribute(name.as_ref());
            }
        });

        self
    }
/// Adds a dynamic property 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 = Signal::new(Some(false));
///
/// input()
///     .attr("type", "checkbox")
///     .dyn_prop("checked", checked.handle())
///     .build()
/// }
/// ```
Adds a dynamic property on the node.
If `value` is `None`, the attribute will be completely removed
from the node.
Adds a dynamic property on the node . If ` value ` is ` None ` the attribute will be completely removed from the node .
pub fn dyn_prop<N, T>(&self, name: N, value: ReadSignal<Option<T>>) -> &Self
    where
        N: ToString,
        T: ToString,
    {
        let element = self.element.clone();
        let name = name.to_string();
        create_effect(move || {
            let v = value.get();
            if let Some(v) = &*v {
                element.set_attribute(name.as_ref(), v.to_string().as_ref());
            } else {
                element.remove_attribute(name.as_ref());
            }
        });
        self
    }
pub fn dyn_prop < N , T > ( & self , name : N , value : ReadSignal < Option < T > > ) -> & Self where N : ToString , T : ToString , { let element = self . element . clone ( ) ; let name = name . to_string ( ) ; create_effect ( move | | { let v = value . get ( ) ; if let Some ( v ) = & * v { element . set_attribute ( name . as_ref ( ) , v . to_string ( ) . as_ref ( ) ) ; } else { element . remove_attribute ( name . as_ref ( ) ) ; } } ) ; self }
Adds a dynamic property on the node.
Adds a dynamic property on the node .
&self
name
N
value
ReadSignal<Option<T>>
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
let checked = Signal::new(Some(false)).

input()
.attr("type", "checkbox")
.dyn_prop("checked", checked.handle())
.build()
}
```
let checked = Signal :: new ( Some ( false )) . input () . attr ( " type " " checkbox " ) . dyn_prop ( " checked " checked . handle () ) . build () } ` ` `