pub const main_align: (&'static str, Option<&'static str>, bool);Expand description
§main_align
Control how the inner elements are positioned inside the element. You can combine it with the direction attribute to create complex flows.
Accepted values for main_align:
start(default): At the begining of the axiscenter: At the center of the axisend: At the end of the axisspace-between(only formain_align): Distributed among the available spacespace-around(only formain_align): Distributed among the available space with small margins in the sidesspace-evenly(only formain_align): Distributed among the available space with the same size of margins in the sides and in between the elements
When using the vertical direction it uses the Y axis and in horizontal direction it uses the X axis.
Example on how to center the inner elements in the main axis:
§Example
fn app() -> Element {
rsx!(
rect {
width: "100%",
height: "100%",
main_align: "center",
rect {
width: "50%",
height: "50%",
background: "red"
},
}
)
}