In a nutshellLayout defines how large an element is through its width and height, and where it sits on the portal page, through its distance from the edges of its parent container. Together these two controls determine the element's footprint on the page, how much space it occupies, and exactly where that space is positioned.
For example, when an H-Stack is placed inside a Canvas, its position relative to each edge of the stack can be defined individually.
Layout is divided into two groups of controls:
Control | Description | Unit |
T (Top) | Distance from the canvas' top edge. | This property's value can be set in pixels or percentage. |
L (Left) | Distance from the canvas' left edge. | |
R (Right) | Distance from the canvas' right edge. | |
B (Bottom) | Distance from the canvas' bottom edge. |
Note: Position controls (T, L, R, B) are only visible when the stack's direct parent is a Canvas element. For other element's whose parent container is an H-Stack, V-Stack, or the portal page itself, position is managed by the parent stack's alignment and spacing settings and these controls will not be available separately.| Value | How it works |
| px | Lets you define the width and height in fixed pixel values. The element holds that size regardless of the screen or parent container's size. This can be chosen when the element needs a precise, consistent size across all contexts. |
| % | Allows you to set percentage values of the parent container's resolved width or height. This can be chosen when the element should scale proportionally with its parent container. |
| Auto | Sizes the element according to the content within it or child elements. Note: Auto is not available on child element since it uses absolute positioning for its child elements. |
| Fill (Available only when the parent container is a H-Stack or V-Stack) |
Expands to consume the remaining space along the main axis of the parent container. This can be chosen when the element should stretch to occupy all available space. |
Note: Position can be set only for a stack element placed within a canvas.Layout is available on the primitives and composite elements listed below. Apart from this, it is also listed as a style property in all presets.