Skip to main content

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

string
required
The ID of the frame to modify
number
Top padding value in pixels
number
Right padding value in pixels
number
Bottom padding value in pixels
number
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 padding

Design 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+