Skip to main content

Module layout

Module layout 

Source
Expand description

Small layout helpers on top of ratatui_core::layout: centring, padding, fixed rows/columns, and an Overlay queue for things drawn after everything else (dropdowns, tooltips).

Structs§

Overlay
Deferred drawing queue: widgets push closures that must paint over everything else (dropdown lists, tooltips, menus). Drain it at the end of the frame.

Functions§

center
A w×h rectangle centred in area (clamped to fit).
center_h
Horizontal centring only, full height.
cols
columns
Equal columns with gap between them.
direction_split
flow
A flow layout: places fixed-size boxes left→right, wrapping to the next line.
grid
Grid of cols×rows cells with gaps.
pad
Shrink by x cells left/right and y cells top/bottom.
pad_trbl
Shrink with individual sides (top, right, bottom, left), CSS order.
popup_below
Anchor a w×h popup next to anchor, preferring below, flipping above when it would overflow bounds, and sliding horizontally to stay inside.
rows
Split into rows of the given heights; the last Constraint::Fill takes the rest.
stack
Fixed-height rows with gap between them; the last one takes the remainder.