Auto Padding Text Box

Dynamically sizes a shape-layer rectangle to hug the text with equal padding.

Code

// Shape Layer > Size
var pad = 40; // pixels
var sr = thisComp.layer("TXT").sourceRectAtTime();
[sr.width + pad, sr.height + pad];
layouttextresponsive

How to Use

Create a text layer named “TXT”, add a rectangle shape, paste this on the rectangle’s Size. Box resizes when text changes.