pub struct ElementBuilder { /* private fields */ }
Expand description

Build an HTML element.

Implementations§

Set an attribute. Attribute values can be reactive.

Add a child element after existing children. The child element can be reactive.

Add a text node after existing children. The text node can be reactive.

Apply an effect after the next render. For example, to set the focus of an element:

element.effect(|elem: &HtmlInputElement| elem.focus().unwrap());

Effects can be reactive. For example, to set the visibibilty of an item based on a hidden boolean signal:

let hidden = Signal::new(false);
let is_hidden = hidden.read();

element.effect(is_hidden.map(|&hidden| move |elem: &HtmlInputElement| elem.set_hidden(hidden)));

Register an event handler.

name is the name of the event. See the MDN Events page for a list.

f is the callback when the event fires and will be passed the javascript Event object.

Trait Implementations§

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.