View all expressions
Conditional

Responsive Text Layout (with Slider Controls)

Simulates responsive text box layouts like in Figma or web design tools. Lets you control and animate the width of the text box using a slider, and automatically scales the font and line spacing to fit cleanly.

Contributed by:


// Add to Source Text
textSize = effect("Font Size")("Slider");
targetWidth = effect("Text Box Width")("Slider");
textLeading = effect("Leading")("Slider");
originalBoxWidth = 1920;
boxScale = targetWidth / originalBoxWidth;
text.sourceText.style.setFontSize(textSize / boxScale).setLeading(textSize * textLeading / boxScale);
// Add to Scale
targetWidth = effect("Text Box Width")("Slider");
originalBoxWidth = 1920;
boxScale = targetWidth / originalBoxWidth;
value * boxScale;

Responsive Text Layout (with Slider Controls)

Practical use case

Perfect for creating dynamic titles, captions, or UI layouts where you want to control the text container width manually. Great for building resizable lower-thirds or templates with flexible layouts.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image