Aspect Ratio

Maintain a specific ratio between width and height.

The aspectRatio property sets a preferred ratio for the item's dimensions. It can derive an auto dimension from the other dimension. Explicit sizes, min/max constraints, and the surrounding layout still determine the final dimensions.

Usage

Pass a single number representing the ratio width / height.

  • 1.0 = Square (1:1)
  • 1.5 = Landscape (3:2)
  • 1.77 ≈ 16:9
  • 0.56 ≈ 9:16

Example

Loading Preview…

Next Steps

© 2026 ByteLand Technology Limited