RemotionUI

Stroke To Fill Text

Draw type as an outline, then flood each letter solid. Install with npx remotion-ui@latest add stroke-to-fill-text.

PrimitivePrimitives

stroke-to-fill-text30fps · 960×540
Install
$ npx remotion-ui@latest add stroke-to-fill-text

Outline first, then a flood that travels through the line.

import { StrokeToFillText } from "@/remotion/primitives/stroke-to-fill-text";

<StrokeToFillText
  text="Ship faster with source"
  strokeColor="#e8b86d"
  fillColor="#f4f4f5"
  staggerInFrames={5}
  direction="up"
/>

The outline is not staggered; the fill is

They ran on one clock in the first cut, and a slow stagger then left the un-flooded half of the line completely absent — the word looked truncated rather than outlined. The whole outline now draws once across outlineInFrames, and the stagger is spent entirely on the flood, which is the part the eye is meant to follow.

Two layers of the same span

The outline and the fill are the same <span> of real text stacked on itself, so they are guaranteed to be the same glyph at the same metrics. Tracing a fill with a second element positioned by hand drifts by a fraction of a pixel and the outline starts reading as a drop shadow.

The flood is a gradient mask rather than a background-clip trick, because a mask can move — and the moving edge is the effect. direction takes up, down, left or right; edgeSoftness is how wet that edge is.

Weights

strokeWidth is the outline in px and strokeRetain is the share of it left once the letter is full — keeping a little makes the fill read as ink inside a drawn letter instead of as a swap between two typefaces.

The outline is unstaggered and the fill is staggered. Running both on one clock leaves the un-flooded half of the line absent, which reads as truncated type.

Agent notes

Install first, then import the copied source component locally. AI guide →

Import
@/remotion/primitives/stroke-to-fill-text
  • Use when: frame-level motion primitives and reusable animation wrappers.
  • Customize: text, strokeWidth, strokeColor, fillColor, plus copied source for timing, layout, colors, and typography.
  • Rule: do not import this component from the remotion-ui npm package; it is copied into your project.

Usage

Example
import { StrokeToFillText } from "@/remotion/primitives/stroke-to-fill-text"; <StrokeToFillText text="Ship faster with source" strokeColor="#e8b86d" staggerInFrames={5} />

API Reference

PropTypeDescription
textstringThe line that outlines and then fills.
strokeWidthnumberOutline weight in px, before it thins into the fill.
strokeColorstringOutline colour. Defaults to `color`.
fillColorstringColour the letter fills with. Defaults to `color`.
direction"up" | "down" | "left" | "right"Which way the fill floods the letter.
edgeSoftnessnumberSoftness of the fill edge, as a share of the glyph. 0 is a hard line.
strokeRetainnumberShare of the outline weight left once the letter is full.
outlineInFramesnumberFrames the outline takes to draw. It arrives as a whole word, unstaggered.
staggerInFramesnumberFrames between one letter flooding and the next.
durationInFramesnumberLength of one letter's flood.
delayInFramesnumberFrames before the outline starts.
order"start" | "end" | "center" | "edges" | "random"Which letter floods first.
exitAtInFramesnumberFrame the fill starts draining on.

Related

On this page