Motion Trail
Echo trails behind a moving element, rendered from earlier frames. Install with npx remotion-ui@latest add motion-trail.
PrimitivePrimitivesAdvanced
$ npx remotion-ui@latest add motion-trailWhere the thing just was.
import { MotionTrail } from "@/remotion/primitives/motion-trail";
<MotionTrail count={6} gapInFrames={3}>
<TheMovingThing />
</MotionTrail>The trick
An echo is not a copy of the element's position — it is the element itself,
rendered at an earlier frame. <Sequence from={n}> shifts the frame its
children see by -n, so an echo at from={gap * i} renders exactly what the
subject looked like gap * i frames ago.
That means the trail is correct for any motion at all: rotation, colour changes, shape changes, a chart redrawing itself. There is no path to describe, no previous position to store, and nothing to keep in sync when the subject's animation changes.
The requirement
The child must animate from useCurrentFrame(). A subject positioned by a
prop, or by a parent's transform, looks identical on every past frame and every
echo stacks in one place. This is the one way to hold it wrong.
Cost
count echoes render the subtree count + 1 times per frame. Keep the subject
small, and prefer a wider gapInFrames over a higher count when the trail
needs length — a longer gap stretches the trail for free, where a higher count
buys smoothness at full price.
Behaviour at the start
Echoes before frame gap * i do not exist yet, so a trail grows in naturally
over its own length at the start of a composition rather than appearing fully
formed on frame 0.
An echo is not a copy of a position — it is the subject re-rendered at an earlier frame, via `<Sequence from={gap * i}>`. That makes the trail correct for any motion, including rotation and colour change, with no path to describe. It also costs `count + 1` renders of the subtree per frame, so prefer a wider gap over a higher count.
Agent notes
Install first, then import the copied source component locally. AI guide →
@/remotion/primitives/motion-trail- Use when: frame-level motion primitives and reusable animation wrappers.
- Customize: count, gapInFrames, opacity, falloff, plus copied source for timing, layout, colors, and typography.
- Rule: do not import this component from the
remotion-uinpm package; it is copied into your project.
Usage
import { MotionTrail } from "@/remotion/primitives/motion-trail";
<MotionTrail count={6} gapInFrames={3}>
<TheMovingThing />
</MotionTrail>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | - | The moving element. It must animate from `useCurrentFrame()`. |
| count | number | 6 | How many echoes trail behind. |
| gapInFrames | number | 3 | Frames between echoes. Wider gaps stretch the trail for free. |
| opacity | number | 0.45 | Opacity of the freshest echo. |
| falloff | number | 1.6 | How fast echoes fade. 1 is linear, 2 keeps the tail short. |
| scale | number | 0.82 | Scale of the oldest echo. 1 keeps them all the same size. |
| blur | number | 4 | Blur on the oldest echo, in px. |
| color | string | - | Tint the echoes. Omit to echo the element's own colours. |
| blendMode | CSS mix-blend-mode | "screen" | How echoes composite. `screen` is right on a dark stage. |
| block | boolean | false | Fill the parent instead of shrink-wrapping the subject. |