Concoct is a cross platform UI framework for Rust.
This library provides a generic diffing engine for user-interfaces and other reactive systems.
This crate is inspired by Jetpack Compose, xilem, and dioxus.
use concoct::prelude::*;
#[derive(PartialEq)]
struct Counter {
initial_value: i32,
}
impl View for Counter {
fn view(&mut self) -> impl IntoView {
let mut count = use_state(|| self.initial_value);
(
format!("High five count: {count}"),
button("Up high").on_click(move || count += 1),
button("Down low").on_click(move || count -= 1),
)
}
}
fn main() {
concoct::web::run(Counter { initial_value: 0 })
}
Installation
This crate currently requires rust nightly.
You can install concoct for web by running:
cargo add concoct --features web