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.
24
25
26
27
28
29
fn main() {
rui(vstack((
my_control(),
my_control().env(MyControlType::Agro),
)))
}
More examples
Hide additional examples
40
41
42
43
44
45
fn main() {
rui(vstack((
my_control().padding(Auto),
my_control().agro().padding(Auto),
)))
}
29
30
31
32
33
fn main() {
rui(state(std::vec::Vec::new, move |todos, _| {
vstack((add_button(todos), todo_list(todos)))
}));
}
3
4
5
6
7
8
9
10
fn main() {
rui(vstack((
"This is a test.",
rectangle().flex(),
"This is another test.",
rectangle().flex(),
)));
}
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),
))
})
}
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"))
}
Additional examples can be found in: