2 releases
0.2.1 | Oct 10, 2023 |
---|---|
0.2.0 | Jul 24, 2023 |
#223 in #browser
27 downloads per month
Used in async_ui_web
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
~12MB
~222K SLoC