2 releases

0.2.1 Oct 10, 2023
0.2.0 Jul 24, 2023

#161 in #browser


Used in async_ui_web

MPL-2.0 license

160KB
3K SLoC

Async UI Web

See the README.


lib.rs:

For listening to HTML events.

use async_ui_web_html::events::EmitElementEvent;
let button = Button::new();
let text = Text::new();
let mut count = 0;
join((
button.render(text.render()),
async {
loop {
text.set_data(&format!("count = {count}"));
button.until_click().await; // 👈 wait for event!!!
count += 1;
}
}
)).await;

For creating HTML elements.

let my_input = Input::new();
my_input.render().await;

Most types here are named after the HTML tag they represent, for example [Input] corresponds to HTML <input>. There are some exceptions such as [Anchor] corresponding to <a> and [Bold] corresponding to <b>.

Dependencies

~11MB
~218K SLoC