Incular logoIncular
API ReferenceLayout Widgets

Expansible

Expandable header and body section widget.

Expansible { expanded: bool, header: Widget, body: Widget } renders a header that expands to reveal a body (like an expansion tile).

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(
                Expansible::new(Text::new("Header"), Text::new("Body"))
                    .expanded(true),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}

Related: Column.