āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/nolly-studio/cult-ui/components/hover-video-player ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<ComponentPreview name="hover-video-player-demo" className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[70%]" />
npx shadcn@latest add https://cult-ui.com/r/hover-video-player.json
</TabsContent>
<TabsContent value="manual">
<Steps>
<Step>Install the required dependencies:</Step>
npm install motion
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="hover-video-player" /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>export default function Example() {
return (
<HoverVideoPlayer
videoSrc="/demo-video.mp4"
thumbnailSrc="/demo-thumbnail.jpg"
/>
)
}
| Prop | Type | Default | Description |
| ------------------ | ----------- | ---------- | ---------------------------------------- |
| videoSrc | string | required | URL of the video to play |
| thumbnailSrc | string | - | URL of the thumbnail image |
| hoverOverlay | ReactNode | - | Custom overlay shown while hovering |
| pausedOverlay | ReactNode | - | Custom overlay shown when paused |
| loadingOverlay | ReactNode | - | Custom overlay shown while loading |
| playbackStartDelay | number | 0 | Delay before playing video on hover (ms) |
| restartOnPaused | boolean | false | Reset video position when paused |
| enableControls | boolean | false | Show playback controls |
| muted | boolean | true | Start video muted |
| loop | boolean | true | Loop video playback |
| cropTop | number | 0 | Percentage to crop from top |
| cropBottom | number | 0 | Percentage to crop from bottom |
<HoverVideoPlayer
videoSrc="/demo-video.mp4"
thumbnailSrc="/demo-thumbnail.jpg"
/>
<HoverVideoPlayer
videoSrc="/demo-video.mp4"
thumbnailSrc="/demo-thumbnail.jpg"
enableControls
/>
import { Spinner } from "@/components/ui/spinner"
;<HoverVideoPlayer
videoSrc="/demo-video.mp4"
thumbnailSrc="/demo-thumbnail.jpg"
pausedOverlay={<PlayIcon className="h-12 w-12" />}
loadingOverlay={<Spinner />}
hoverOverlay={<div className="text-white">Now Playing</div>}
/>
<HoverVideoPlayer
videoSrc="/demo-video.mp4"
thumbnailSrc="/demo-thumbnail.jpg"
cropTop={10}
cropBottom={10}
/>
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā