Function rui::vstack

source ·
pub fn vstack<VT: ViewTuple + 'static>(children: VT) -> impl View
Expand description

Vertical stack of up to 128 Views in a tuple. Each item can be a different view type.

Examples found in repository?
examples/env.rs (lines 25-28)
24
25
26
27
28
29
fn main() {
    rui(vstack((
        my_control(),
        my_control().env(MyControlType::Agro),
    )))
}
More examples
Hide additional examples
examples/custom_modifier.rs (lines 41-44)
40
41
42
43
44
45
fn main() {
    rui(vstack((
        my_control().padding(Auto),
        my_control().agro().padding(Auto),
    )))
}
examples/todo_list.rs (line 31)
29
30
31
32
33
fn main() {
    rui(state(std::vec::Vec::new, move |todos, _| {
        vstack((add_button(todos), todo_list(todos)))
    }));
}
examples/basic.rs (lines 4-9)
3
4
5
6
7
8
9
10
fn main() {
    rui(vstack((
        "This is a test.",
        rectangle().flex(),
        "This is another test.",
        rectangle().flex(),
    )));
}
examples/slider.rs (lines 11-14)
9
10
11
12
13
14
15
16
fn my_slider(s: impl Binding<f32>) -> impl View {
    with_ref(s, move |v| {
        vstack((
            v.to_string().font_size(10).padding(Auto),
            hslider(s).thumb_color(RED_HIGHLIGHT).padding(Auto),
        ))
    })
}
examples/gallery.rs (lines 43-50)
42
43
44
45
46
47
48
49
50
51
52
53
fn main() {
    rui(vstack((
        "rui widget gallery".padding(10.0),
        button_example(),
        slider_example(),
        knob_example(),
        toggle_example(),
        text_editor_example(),
    ))
    .padding(Auto)
    .window_title("rui widget gallery"))
}