Two images or videos blended in 3D across a glowing, draggable glass divider. The split refracts the scene with a chromatic edge, the whole plane tilts on pointer parallax, and corner labels call out before and after — a transformation showcase for AI enhancement, photo and video editing, design tools, and beauty tech.
import BeforeAfterSlider from '@crazygl/hero-before-after-slider';
export default function Hero() {
return (
<BeforeAfterSlider
beforeMedia="https://example.com/raw.jpg"
afterMedia="https://example.com/enhanced.jpg"
splitPosition={0.5}
glowColor="#bfe3ff"
/>
);
}beforeMedia / afterMedia (photo or video, AVIF/WebP/PNG/JPG/MP4/WebM, cover-fitted), plus beforeLabel / afterLabel / showLabels corner tags.splitPosition (rest position 0.1–0.9), splitAngle (−30°–30° tilt), refractionStrength, chromaStrength, and handleStyle (arrows / dot / line).glowColor, glowIntensity, parallaxStrength (pointer shear), backgroundTone.headingFontFamily.npm install @crazygl/hero-before-after-sliderThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import CinematicBeforeAfterSlider from '@crazygl/hero-before-after-slider';
export default function Landing() {
return (
<CinematicBeforeAfterSlider />
);
}The wrapper renders static HTML on the server and only initialises the canvas after hydration, so search engines see your copy.
// app/page.tsx — works in SSR-first frameworks (Next, Remix, Astro, etc.)
'use client';
import CinematicBeforeAfterSlider from '@crazygl/hero-before-after-slider';
export default function Page() {
return (
<section>
<CinematicBeforeAfterSlider
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}