35 releases (14 breaking)

0.19.0-alpha.2 Jan 26, 2024
0.17.0 Jan 20, 2024
0.16.4 Dec 16, 2023
0.8.0 Nov 30, 2023
0.1.0 Jan 23, 2023

#769 in GUI

Download history 37/week @ 2024-07-18 259/week @ 2024-07-25 5/week @ 2024-08-01 25/week @ 2024-08-08 5/week @ 2024-08-15 4/week @ 2024-08-22 4/week @ 2024-08-29 7/week @ 2024-09-05 7/week @ 2024-09-12 6/week @ 2024-09-19 21/week @ 2024-09-26 13/week @ 2024-10-03 35/week @ 2024-10-10 26/week @ 2024-10-17 7/week @ 2024-10-24 5/week @ 2024-10-31

77 downloads per month
Used in 3 crates

MIT/Apache

20KB
479 lines

Concoct is a framework for user-interfaces in Rust.

This crate provides a virtual DOM and state management system for any backend. Concoct uses static typing to describe your UI at compile-time to create an efficient tree without allocations.

#[derive(Default)]
struct Counter {
    count: i32,
}

impl View<Counter> for Counter {
    fn body(&mut self, _cx: &Scope<Counter>) -> impl View<Counter> {
        (
            format!("High five count: {}", self.count),
            html::button("Up high!").on_click(|state: &mut Self, _event| state.count += 1),
            html::button("Down low!").on_click(|state: &mut Self, _event| state.count -= 1),
        )
    }
}

Dependencies

~1MB
~21K SLoC