Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A simple counter app using Seed framework.
# seed/demo/counter.rs
use seed::{prelude::*, *};
struct Model { count: i32 }
enum Msg { Increment, Decrement }
fn init(_: Url, _: &mut Orders<Msg>) -> Model {
Model { count: 0 }
}
fn update(msg: Msg, model: &mut Model, _: &mut Orders<Msg>) {
match msg {
Msg::Increment => model.count += 1,
Msg::Decrement => model.count -= 1,
}
}
fn view(model: &Model) -> Node<Msg> {
div![
button![ev(Ev::Click, |_| Msg::Decrement), "-"],
span![model.count],
button![ev(Ev::Click, |_| Msg::Increment), "+"]
]
}
#[wasm_bindgen(start)]
pub fn start() {
App::start("app", init, update, view);
}Seed is a Rust framework for creating front-end web apps with WebAssembly. It provides a component-based architecture inspired by Elm, enabling Rust developers to write type-safe, reactive web applications that compile to Wasm.
Origin & Creator
Seed was created by IcedDev and the Rust community, first appearing around 2018.
Industrial Note
Seed-Rust is ideal for developers who want Rust’s safety and performance for front-end web apps, especially for Wasm-based projects where speed and correctness are critical.