Constant freya_elements::attributes::cross_align::cross_align

source ·
pub const cross_align: (&'static str, Option<&'static str>, bool);
Expand description

§cross_align

Control how the inner elements are positioned inside the element in the axis perpendicular to the direction.

Accepted values:

  • start (default): At the begining of the axis (same as in main_align)
  • center: At the center of the axis (same as in main_align)
  • end: At the end of the axis (same as in main_align)

When using the vertical direction it uses the X axis and in horizontal direction it uses the Y axis.

Example on how to center the inner elements in the cross axis:

fn app() -> Element {
    rsx!(
        rect {
            width: "100%",
            height: "100%",
            cross_align: "center",
            rect {
                width: "50%",
                height: "50%",
                background: "red"
            },
        }
    )
}