Sizing Semantics
This page freezes the intended sizing vocabulary for the current alpha line.
Core Terms
- Preferred size: the size requested by
widthandheight. - Minimum size: the floor applied by
min_widthandmin_height. - Maximum size: the ceiling applied by
max_widthandmax_height. - Intrinsic size: the size measured from content before parent-driven layout adjustments.
UVal Modes
Px: fixed logical size.Percent: percentage of the parent size on that axis.Flex: participates in main-axis free-space distribution.MinContent: smallest intrinsic size that still fits the content.MaxContent: full intrinsic size without contextual stretch.Content: legacy public alias forMaxContent.Auto: contextual size. It falls back to intrinsic measurement, but the layout algorithm may stretch or reinterpret it when the surrounding layout calls for that behavior.
Current Rules
- Explicit
min_*andmax_*always clamp the solved size, including flex grow and flex shrink redistribution. Autois no longer treated as the same mode asContent.- In grid placement,
Autoitems can stretch to the cell by default.MinContentandMaxContentkeep their intrinsic size unless alignment explicitly asks for stretch. - In flex cross-axis stretch behavior,
Autoparticipates in implicit stretch. Explicit alignment can still force stretch for non-fixed, non-percent modes. UImagetreatsAuto,Content,MinContent, andMaxContentas native-image measurement modes. Images have one intrinsic size, so these modes all resolve to the texture size once the asset is ready.
Practical Guidance
- Use
Autowhen the size should adapt to layout context. - Use
MaxContentorContentwhen the element should hug its measured content and avoid implicit auto-stretch behavior. - Use
MinContentwhen you want the tightest intrinsic fit. - Add
min_width/max_widthormin_height/max_heightwhen you need hard bounds around any of the modes above.