Incular logoIncular
API ReferenceLayout Widgets

OverflowBar

Button row with spacing that wraps overflowing actions.

OverflowBar is a Row with spacing that lowers to Wrap when actions overflow.

use incular::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(
                OverflowBar::new(Vec::<Widget>::from([
                    Text::new("Cancel").into(),
                    Text::new("OK").into(),
                ]))
                .spacing(8.0)
                .overflow_spacing(4.0)
                .overflow_alignment(WrapCrossAlignment::End),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}

Props

Prop

Type

Related: Row, Wrap.

On this page