Puzzle Video
A video player that shatters into a jigsaw puzzle based on scroll progress.
ui Premium Plan
Availability
Included in Premium Plans
This flagship component is part of Future UI's monthly & yearly Premium plans and is not distributed via the free public CLI.
Import
import { PuzzleVideo } from "@/components/ui/puzzle-video"
Options
Aspect Ratio:
Named Keys & Props
Pass these exact named keys as props on <PuzzleVideo />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"jigsaw""jigsaw-uneven""glass"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import dynamic from 'next/dynamic';
import { useRef } from 'react';
const PuzzleVideo = dynamic(() => import('@/components/ui/puzzle-video').then(mod => mod.PuzzleVideo), { ssr: false });
export default function Example() {
const containerRef = useRef<HTMLDivElement>(null);
return (
<div ref={containerRef} className="h-screen overflow-y-auto overflow-x-hidden">
<div style={{ marginTop: '100vh', paddingBottom: '100vh' }}>
<PuzzleVideo scrollContainer={containerRef} src="/videos/video.mp4" rows={4} cols={3} />
</div>
</div>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Jigsaw clip paths to cut the video frame.
- ◆Matching tabs for interlocking puzzle pieces.
- ◆Scroll-driven progress utilizing Framer Motion.
- ◆Optimized 30fps RAF loop pausing off-screen.
Notes
Important implementation details to consider.
Implementation Details
- ◆Plan: Included in Future UI Monthly & Yearly Premium Plans.
- ◆Import dynamically to bypass SSR issues: const PuzzleVideo = dynamic(() => import('@/components/ui/puzzle-video').then(mod => mod.PuzzleVideo), { ssr: false });
- ◆Pass the 'src' prop with a valid video URL.
- ◆Customize grid density using 'rows' and 'cols'.