class RatatuiRuby::Constraint

Defines the sizing rule for a layout section.

Flexible layouts need rules. You can’t just place widgets at absolute coordinates; they must adapt to changing terminal sizes.

This class defines the rules of engagement. It tells the layout engine exactly how much space a section requires relative to others.

Mix and match fixed lengths, percentages, ratios, and minimums. Build layouts that breathe.

Examples

Constraint.length(5)      # Exactly 5 cells
Constraint.percentage(50) # Half the available space
Constraint.min(10)        # At least 10 cells, maybe more
Constraint.fill(1)        # Fill remaining space (weight 1)