concoct 0.5.0

Generic UI compiler and runtime library
Documentation

Concoct

crate Rust Documentation CI

Examples

Rust zero-cost reactive UI framework.

Features

  • Inspired by the elm architecture
  • Compile-time UI tree
enum Event {
    Increment,
    Decrement,
}

fn counter(count: &i32) -> impl View<Event> {
    (
        h1([], count.to_string()),
        button([on("click", Event::Increment)], "More"),
        button([on("click", Event::Decrement)], "Less"),
    )
}

fn main() {
    concoct::run(
        0,
        |count, event| match event {
            Event::Increment => *count += 1,
            Event::Decrement => *count -= 1,
        },
        counter,
    );
}