Overview
Control how an auto-layout frame resizes itself in response to its content and parent container. Choose between fixed dimensions, hugging content, or filling available space.Parameters
The ID of the frame to modify
Horizontal sizing modeOptions:
FIXED- Frame has a fixed widthHUG- Frame width adjusts to fit its content (for frames/text only)FILL- Frame fills available width in parent auto-layout (for auto-layout children only)
Vertical sizing modeOptions:
FIXED- Frame has a fixed heightHUG- Frame height adjusts to fit its content (for frames/text only)FILL- Frame fills available height in parent auto-layout (for auto-layout children only)
- Use
HUGwhen you want the frame to automatically resize based on its content - Use
FILLwhen the frame is a child of an auto-layout parent and should take up available space - Use
FIXEDwhen you need precise control over dimensions
Response
Examples
Button that hugs content width
Card that fills container width
Fixed-size container
Sidebar that fills height
Sizing Mode Behavior
FIXED
- Frame maintains explicit width/height values
- Content may overflow or be clipped
- Best for: Avatars, icons, fixed-width sidebars
HUG
- Frame automatically resizes to fit content
- Respects padding and spacing settings
- Best for: Buttons, tags, chips, labels
- Limitation: Only works on frames/text, not on auto-layout children
FILL
- Frame expands to fill available space in parent
- Requires parent to be an auto-layout frame
- Best for: Content areas, cards in lists, responsive layouts
- Limitation: Only works for children of auto-layout frames
Use Cases
Buttons:HUG/HUG - Automatically size based on text content
List items: FILL/HUG - Fill parent width, hug content height
Cards: FILL/HUG - Responsive width, height based on content
Navigation sidebar: FIXED/FILL - Fixed width, fill full height
Modal content: FIXED/HUG - Fixed width, height adjusts to content
Common Patterns
Responsive Card List
Button Group
Related Tools
- set_layout_mode - Enable auto-layout on a frame
- set_padding - Add spacing inside frames
- set_axis_align - Control child alignment
- resize_node - Manually resize frames