Skip to main content

Module layout

Module layout 

Source
Expand description

Layout composition widget.

A 2D grid-based layout container that places child widgets using Grid constraints. Each child is assigned to a grid cell or span, and the grid solver computes the final placement rects.

This widget is glue over ftui_layout::Grid — it does not implement a parallel constraint solver.

§Example

use ftui_widgets::layout::Layout;
use ftui_layout::Constraint;

let layout = Layout::new()
    .rows([Constraint::Fixed(1), Constraint::Min(0), Constraint::Fixed(1)])
    .columns([Constraint::Fixed(20), Constraint::Min(0)])
    .child(header_widget, 0, 0, 1, 2)  // row 0, col 0, span 1x2
    .child(sidebar_widget, 1, 0, 1, 1)
    .child(content_widget, 1, 1, 1, 1)
    .child(footer_widget, 2, 0, 1, 2);

Structs§

Layout
A 2D grid-based layout container.
LayoutChild
A child entry in the layout grid.