# Before After

Comparison slider: a divider with a handle wipes from one position to another, revealing "after" past it.

```bash
npx shadcn add https://www.reelcn.dev/r/before-after.json
```

Usage:

```tsx
<BeforeAfter labels={["Before", "After"]} before={<OldUI />} after={<NewUI />} />
```

Use for:

- Redesigns, edits and upgrades: anything with a clear before and after state
- A single screenshot that changes at one point, rather than two panes shown at once

Avoid:

- Two panes shown side by side the whole time. Use `split-screen`

Dependencies:

- `remotion`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| delay? | `number` | — | Frames to wait before entering. |
| duration? | `number` | — | Enter duration in frames. Defaults to 0.6s. Some items reuse `duration` for an unrelated local timing. See that item's own prop docs. |
| exit? | `number \| boolean` | — | Exit at the end of the parent `<Sequence>`. `false` keeps it on screen, a number sets the exit length in frames. |
| motion? | `MotionPersonality` | — | Override the theme's motion personality. |
| poster? | `boolean` | — | Renders fully entered, with no exit: for a still frame or thumbnail. Defaults to `false`. |
| holdFrames? | `number` | — | Delays the start of the exit window by this many frames, for a minimum on-screen hold. Defaults to `0`. |
| before | `ReactNode` | — | Content left of the divider. |
| after | `ReactNode` | — | Content right of the divider. |
| to? | `number` | `50` | Divider's resting position, in % of width (0–100). Defaults to 50. |
| from? | `number` | `100` | Divider's starting position before the wipe, in % of width. Defaults to 100 (fully "before"). |
| labels? | `[string, string]` | — | Corner labels: `[beforeLabel, afterLabel]`. |
| dividerColor? | `string` | — |  |
| handleColor? | `string` | — |  |
| labelColor? | `string` | — |  |
| labelBackground? | `string` | — |  |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |