mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Yew
Elm like framework, but for Rust and WASM revolution.
Minimal application
extern crate yew;
use yew::html;
struct Model {
value: u8,
}
enum Msg {
Increment,
Decrement,
}
fn update(model: &mut Model, msg: Msg) {
match msg {
Msg::Increment => {
model.value = model.value + 1;
}
Msg::Decrement => {
model.value = model.value - 1;
}
}
}
fn view(model: &Model) -> html::Html<Msg> {
html! {
<div>
<nav>
<button></button>
<button></button>
</nav>
<input></input>
</div>
}
}
fn main() {
let model = Model {
value: 0,
};
html::program(model, update, view);
}
Description
Languages
Rust
96.9%
JavaScript
1.4%
Shell
0.6%
Python
0.4%
TypeScript
0.4%
Other
0.2%