altui-core 0.2.0

A library to build rich terminal user interfaces or dashboards
Documentation
/// Controls how free space is distributed along the main axis.
///
/// Flex is applied after all constraints are resolved and only affects
/// positioning, not sizing.
///
/// The main axis depends on layout direction:
/// * horizontal → X axis
/// * vertical → Y axis
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
pub enum Flex {
    /// Legacy behavior preserved for backward compatibility.
    ///
    /// The exact behavior is implementation-defined and may change.
    Legacy,

    /// Packs elements toward the start of the area.
    ///
    /// ```text
    /// |[A][B][C]        |
    /// ```
    #[default]
    Start,

    /// Packs elements toward the end of the area.
    ///
    /// ```text
    /// |        [A][B][C]|
    /// ```
    End,

    /// Centers elements as a group.
    ///
    /// ```text
    /// |    [A][B][C]    |
    /// ```
    Center,

    /// Distributes free space only between elements.
    ///
    /// No gap is added before the first or after the last element.
    ///
    /// ```text
    /// |[A]    [B]    [C]|
    /// ```
    SpaceBetween,

    /// Distributes free space evenly around all elements.
    ///
    /// The gap before the first element, between elements, and after
    /// the last element is equal.
    ///
    /// ```text
    /// |  [A]  [B]  [C]  |
    /// ```
    SpaceAround,
}