counter/
counter.rs

1use rui::*;
2
3fn main() {
4    rui(state(
5        || 1,
6        |count, cx| {
7            vstack((
8                cx[count].padding(Auto),
9                button("increment", move |cx| {
10                    cx[count] += 1;
11                })
12                .padding(Auto),
13            ))
14        },
15    ));
16}