Hero: video
Hero with a product video under the headline. Never autoplays.
Preview
A poster with a play button; pressing it grows the poster into the player and starts the video. With reduced motion turned on, it renders the plain layout.
See the product in 60 seconds
A poster, a play button and your product tour. Sample copy.
See the product in 60 seconds
A poster, a play button and your product tour. Sample copy.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { HeroVideo } from "@/components/custom/hero-video";
<HeroVideo
title="See the product in 60 seconds"
poster={tour.posterUrl}
posterAlt="Product tour"
videoSrc={tour.videoUrl}
captionsSrc={tour.captionsUrl}
/>import { HeroVideoMotion } from "@/components/custom/hero-video/hero-video-motion";
<HeroVideoMotion title="See the product in 60 seconds" poster={tour.posterUrl} posterAlt="Product tour" videoSrc={tour.videoUrl} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| poster* (required) | string | – | Image shown before playback. |
| posterAlt* (required) | string | – | What the video shows; labels the video and play button. |
| videoSrc* (required) | string | – | Video file URL. |
| captionsSrc | string | – | WebVTT captions, added as a default English track. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| poster* (required) | string | – | Image shown before playback. |
| posterAlt* (required) | string | – | What the video shows; labels the video and play button. |
| videoSrc* (required) | string | – | Video file URL. |
| captionsSrc | string | – | WebVTT captions, added as a default English track. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The video never autoplays and keeps native controls.
- Add captions with captionsSrc.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.