Ink Underline

Hand-drawn ink underline for Remotion: a brush stroke drags itself under a handwritten headline, URL or stat in a few stop-motion steps, timed after the writing.

In Remotion, Ink Underline adds a hand-dragged ink stroke that draws itself under a handwritten headline in a few stop-motion steps. Set its delay from handwriteDuration() and it starts right after the writing finishes; use it under a URL, a stat or a title in a paper or scrapbook scene.

Installation
$ pnpm dlx shadcn@latest add @remocn/ink-underline

How to build this in Remotion

You don't need @remotion/paths, evolvePath() or an SVG filter for this. Install the component:

bash
npx shadcn@latest add @remocn/ink-underline

The stroke is an SVG brush ribbon sampled from a seeded curve, revealed on the remocn stop-motion clock in discrete poses, so it moves in the same choppy steps as handwrite. Its single schedule entry lives in timeline.ts: the drag starts at delay and lasts durationSteps × step frames.

Good to know

  • Length: 120 frames of motion at 30 fps (240 at 60 fps) with the default props. The stroke itself only takes durationSteps × step frames (15 with the defaults) after delay; the rest of the 120 is hold. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion are doubled, see Frame rate.
  • Installs: remotion from npm, plus the remocn helpers stop-motion, brush, frame-rate, timeline. The shadcn CLI copies the source into your project.
  • No font: the stroke is drawn, not typed.
  • delay, step and handwriteDuration() all count 30 fps frames on the scene clock, so passing handwriteDuration(text) as delay lines up at any composition frame rate.
  • Width: the stroke is width pixels long and does not measure the text above it. Give the underline the same width as the box the headline sits in, as the Usage example does.

Usage

The stroke renders in normal flow — a block of width by thickness + 4 — so it stacks under text in a flex column. Pair it with handwrite and start the drag the moment the writing finishes:

tsx
// src/Root.tsx
import { AbsoluteFill, Composition } from "remotion";
import { Handwrite, handwriteDuration } from "@/components/remocn/handwrite";
import { InkUnderline } from "@/components/remocn/ink-underline";
 
const url = "remocn.dev";
 
const InkUnderlineScene = () => (
  <AbsoluteFill
    style={{
      background: "#f1eee7",
      alignItems: "center",
      justifyContent: "center",
      flexDirection: "column",
      gap: 4,
    }}
  >
    <div style={{ position: "relative", width: 420, height: 96 }}>
      <Handwrite text={url} fontSize={64} />
    </div>
    <InkUnderline width={420} delay={handwriteDuration(url)} />
  </AbsoluteFill>
);
 
export const RemotionRoot = () => (
  <Composition
    id="InkUnderline"
    component={InkUnderlineScene}
    durationInFrames={120}
    fps={60}
    width={1280}
    height={720}
  />
);

Handwrite centres itself inside its nearest positioned ancestor, which is why it sits in a sized position: relative box here. The underline needs no such box — it is a block in the flow.

The wobble in the stroke comes from seed: the same seed always draws the same curve, and changing it gives a different hand. durationSteps is how many stop-motion poses the drag takes, so the real length in frames is durationSteps * step.

Props10

PropTypeDefault
widthrequired
number—

Stroke length in pixels

color
string"#6f7f35"

Ink colour (any valid CSS color)

thickness
number9

Brush width in pixels at full pressure

pressure
number1

Weight the brush lands on, as a fraction of thickness

release
number0.15

Weight the brush lifts off at; below pressure it thins into a dry tail

grain
number1

Edge roughness; breaks the thin tail into dry-brush flecks, 0 gives clean edges

delay
number0

Frames on the local clock before the drag begins

durationSteps
number5

Stop-motion poses the drag takes

seed
string"ink"

Seed for the curve wobble — same seed, same stroke

step
number3

Frames per stop-motion pose — the tempo control

  • widthrequirednumber

    Stroke length in pixels

  • colorstring

    Ink colour (any valid CSS color)

    Default"#6f7f35"

  • thicknessnumber

    Brush width in pixels at full pressure

    Default9

  • pressurenumber

    Weight the brush lands on, as a fraction of thickness

    Default1

  • releasenumber

    Weight the brush lifts off at; below pressure it thins into a dry tail

    Default0.15

  • grainnumber

    Edge roughness; breaks the thin tail into dry-brush flecks, 0 gives clean edges

    Default1

  • delaynumber

    Frames on the local clock before the drag begins

    Default0

  • durationStepsnumber

    Stop-motion poses the drag takes

    Default5

  • seedstring

    Seed for the curve wobble — same seed, same stroke

    Default"ink"

  • stepnumber

    Frames per stop-motion pose — the tempo control

    Default3

Common questions

How do I add a hand-drawn ink underline under a handwritten headline in Remotion?

Install Ink Underline with npx shadcn@latest add @remocn/ink-underline, place it under the text in a flex column and set delay={handwriteDuration(text)} so the drag starts when the writing ends.

Is handwriteDuration in frames?

Yes, in 30 fps frames on the scene clock, the same unit delay uses, so it fits any composition frame rate.

  • Marker Highlight: a marker block painted behind a phrase inside a sentence.
  • Handwrite: pen-written text on the same stop-motion clock.
  • Hand Count: a number rewritten by hand at each step.