Skip to main content

Module layout_engine

Module layout_engine 

Source
Expand description

Layout calculation for Row / Column containers.

Provides flex-grow–style weighted splitting, justify (main-axis), and align (cross-axis) helpers that work on ratatui::layout::Rect.

Functions§

apply_align
Position a single item on the cross axis according to an Align rule.
apply_justify
Position items along the main axis according to a Justify rule.
flex_layout
Flexbox-style layout along the main axis.
padded_content
Content rect inside the standard 1-cell margin, but guaranteed never to collapse to zero — so a leaf nested in a tight area (e.g. a Text label inside a Button’s 1-row content area) still renders instead of vanishing.
weighted_split
Split a Rect into n segments based on optional weights.