UNode and Box Metrics
UNode is the fundamental building block of every UI element.
Main Fields
widthheightmin_widthmax_widthmin_heightmax_heightpaddingmarginbackground_colorborder_radiusshape_mode
Supported units:
UVal::PxUVal::PercentUVal::MinContentUVal::MaxContentUVal::ContentUVal::AutoUVal::Flex
Sizing Notes
widthandheightare the preferred size request.min_width,max_width,min_height, andmax_heightclamp the solved result.paddingparticipates in intrinsic measurement, whilemarginaffects placement and wrap span rather than the node’s inner measured content.UVal::Contentis the legacy alias forUVal::MaxContent.UVal::Autois contextual rather than identical toContent.- Use
MaxContentorMinContentwhen you want explicit intrinsic sizing without implicit auto-stretch behavior. border_radiusandshape_modestay visual-only; they do not change the measured layout size by themselves.
See Sizing Semantics for the current detailed rules.
Final Size
After layout solving, every entity receives:
ComputedSize
That final size is what rendering uses.
UBorder
Borders are visually separate from the UNode background and support:
- width
- color
- rounded corners
Shape Modes
Round: rounded SDF cornersCut: beveled or cut corners