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

#834 in GUI

Download history 46/week @ 2024-07-20 250/week @ 2024-07-27 7/week @ 2024-08-03 27/week @ 2024-08-10 1/week @ 2024-08-17 5/week @ 2024-08-24 3/week @ 2024-08-31 12/week @ 2024-09-07 2/week @ 2024-09-14 10/week @ 2024-09-21 21/week @ 2024-09-28 30/week @ 2024-10-05 16/week @ 2024-10-12 30/week @ 2024-10-19

99 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