1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use rui::*;

#[derive(Default)]
struct MyState {
    value: f32,
}

make_lens!(ValueLens, MyState, f32, value);

fn main() {
    rui(state(MyState::default, |state, cx| {
        vstack((
            cx[state].value.font_size(10).padding(Auto),
            hslider(bind(state, ValueLens {}))
                .thumb_color(RED_HIGHLIGHT)
                .padding(Auto),
        ))
    }));
}