Overview
Add spacing between the edges of an auto-layout frame and its children. You can set padding independently for each side or use the same value for all sides.Parameters
The ID of the frame to modify
Top padding value in pixels
Right padding value in pixels
Bottom padding value in pixels
Left padding value in pixels
You can set one or more padding values in a single call. Only the specified sides will be updated.
Response
Examples
Uniform padding on all sides
Horizontal and vertical padding
Update only specific sides
Card with comfortable spacing
Use Cases
Buttons: Add 12-16px vertical and 20-32px horizontal padding for comfortable click targets Cards: Use 20-32px padding on all sides to create breathing room around content Containers: Apply 16-24px padding to separate content from container edges List items: Add 12-16px horizontal padding and 8-12px vertical paddingDesign Tips
- Use multiples of 4 or 8 for consistent spacing in your design system
- Horizontal padding is often larger than vertical for buttons
- Cards typically have equal padding on all sides
- Dense layouts use 8-12px, comfortable layouts use 16-24px, spacious layouts use 32px+
Related Tools
- set_item_spacing - Control spacing between children
- set_layout_mode - Enable auto-layout on a frame
- create_frame - Create frames with padding from the start