Scenes
Before After
Two versions in one frame: a handle sweeps across the picture uncovering the second version, overshoots, comes back and settles in the middle so both sides stay readable.
- Type
- Animation
- Duration
- 4.4s
- Category
- Scenes
- Source
- Imgcli
Install
Two versions in one frame: a handle sweeps across the picture uncovering the second version, overshoots, comes back and settles in the middle so both sides stay readable.
Installation
npx @imgcli/cli add before-afterUsage
import { BeforeAfter } from "@/components/imgcli/before-after";
<BeforeAfter />Render at 30 fps for 132 frames (4.4 seconds) with the default props. The preview uses a 960 × 540 canvas.
Use <BeforeAfter before="/old.png" after="/new.png" beforeLabel="Before" afterLabel="After" /> for 132 frames at 30 fps (BEFORE_AFTER_SECONDS). Both images share one framing.
| Prop | Type | Default | Description |
|---|---|---|---|
before | string | lightPage | Two images of the same framing; the slider uncovers `after` from the right. |
after | string | darkPage | |
beforeLabel | string | "Light" | |
afterLabel | string | "Dark" | |
aspect | number | 1.6 | Width ÷ height of both images. |
title | string | "One theme prop, both modes." | |
fontFamily | string | — | A face from the Imgcli font list, or any loaded CSS font stack. |
accentColor | string | — | |
theme | Partial<ImgcliTheme> | — | |
mode | "light" | "dark" | — | |
speed | number | 1 |
License
MIT. Free for personal and commercial use. Preserve the copyright and license notice.
Copyright (c) 2026 Ricky (Imgcli) <https://imgcli.com>
Frequently asked questions
How do I add Before After to a Remotion project?
Run npx @imgcli/cli add before-after in your Remotion project. The CLI copies the editable source into components/imgcli/ under your source root and installs its dependencies.
What is Before After?
Before After is a Remotion before after slider for React. Two versions in one frame: a handle sweeps across the picture uncovering the second version, overshoots, comes back and settles in the middle so both sides stay readable.
What do I need before using Before After?
Use Node.js 20.19 or newer and an existing Remotion project. Create one with npx create-video@latest. The component is free and MIT licensed.