Before After Card

Drag the handle to wipe between before and after images with absolutely zero lag.

elite micro interactionsbeforeaftercardframer motion
Before After Card component preview

Props

PropTypeDefaultDescription
afterSrcstring-Fully revealed after image URL.
beforeSrcstring-Optional before image. When omitted, afterSrc is shown desaturated.
beforeLabelstring"Before"Corner label on the before side.
afterLabelstring"After"Corner label on the after side.
captionstring-Optional line under the frame.
orientation"horizontal" | "vertical""horizontal"Wipe axis.
defaultPositionnumber50Uncontrolled start position, 0–100.
positionnumber-Controlled position, 0–100.
onPositionChange(position: number) => void-Fired when the wipe position changes.
showPercentbooleantrueShow a live percent near the handle.
autoDemobooleantrueOne-shot idle scrub on first mount.