HeroesSimpleApril 10, 2026
Video Hero
Full-width hero section with an autoplay background video, optional heading, and a CTA button with a slide-up hover animation. Aspect ratio and object position are configurable via props.
View Full Demo →Preview
Source
demo.jsx
import VideoHero from "./index.jsx";
import styles from "./demo.module.css";
export default function VideoHeroDemo() {
return (
<div className={styles.wrapper}>
<VideoHero src="/demo-assets/videos/HomeHeroexample1.mp4" aspectRatio="16 / 9" />
<section className={styles.intro}>
<p className={styles.eyebrow}>Est. 2024</p>
<h2 className={styles.heading}>Designed for motion.</h2>
<p className={styles.body}>
We build web experiences that move — scroll-driven, video-led, and built to last.
</p>
</section>
<VideoHero src="/demo-assets/videos/Novatrexexample.mp4" aspectRatio="16 / 9" />
<section className={styles.works}>
<p className={styles.eyebrow}>Selected Work</p>
<div className={styles.grid}>
{["Novatrex", "Flow State", "Westend", "Kickbass"].map((title) => (
<div key={title} className={styles.card}>
<div className={styles.thumb} />
<span className={styles.cardTitle}>{title}</span>
</div>
))}
</div>
</section>
<VideoHero imgSrc="/demo-assets/videos/HomeImageexample2.webp" aspectRatio="16 / 9" />
<section className={styles.about}>
<p className={styles.eyebrow}>About</p>
<h2 className={styles.heading}>Built different.</h2>
<p className={styles.body}>
Every project starts with intent — understanding the brand, the audience, and the moment.
</p>
</section>
</div>
);
}
index.jsx
import Link from "next/link";
import styles from "./styles.module.css";
export default function VideoHero({
src,
imgSrc,
poster,
title,
ctaLabel,
ctaHref,
aspectRatio = "16 / 9",
objectPosition = "center center",
}) {
return (
<section className={styles.section} style={{ "--aspect-ratio": aspectRatio }}>
{imgSrc ? (
<img
className={styles.video}
src={imgSrc}
alt=""
style={{ objectPosition }}
/>
) : (
<video
className={styles.video}
src={src}
poster={poster}
autoPlay
muted
loop
playsInline
preload="auto"
style={{ objectPosition }}
/>
)}
{title && (
<div className={styles.overlay}>
<h2 className={styles.title}>{title}</h2>
{ctaLabel && ctaHref && (
<Link href={ctaHref} className={styles.cta}>
<span className={styles.ctaInner}>
<span className={styles.ctaDefault}>{ctaLabel}</span>
<span className={styles.ctaHover}>{ctaLabel}</span>
</span>
</Link>
)}
</div>
)}
</section>
);
}
demo.module.css
.wrapper {
background: #fff;
}
/* ---- Shared ---- */
.eyebrow {
font-size: 0.68rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.12em;
color: #aaa;
margin: 0 0 1.25rem;
}
.heading {
font-size: clamp(2rem, 5vw, 4rem);
font-weight: 900;
letter-spacing: -0.03em;
line-height: 1;
color: #111;
margin: 0 0 1.5rem;
}
.body {
font-size: 1rem;
color: #888;
max-width: 420px;
line-height: 1.65;
margin: 0 auto;
}
/* ---- Intro section ---- */
.intro {
padding: 6rem 2rem;
text-align: center;
background: #fff;
}
/* ---- Works section ---- */
.works {
padding: 5rem 2rem;
background: #f8f8f8;
text-align: center;
}
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1.5rem;
max-width: 1000px;
margin: 2rem auto 0;
}
.card {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.thumb {
width: 100%;
aspect-ratio: 3 / 4;
background: #e0e0e0;
}
.cardTitle {
font-size: 0.82rem;
font-weight: 700;
letter-spacing: -0.01em;
color: #111;
}
/* ---- About section ---- */
.about {
padding: 6rem 2rem;
text-align: center;
background: #111;
}
.about .eyebrow {
color: #555;
}
.about .heading {
color: #fff;
}
.about .body {
color: #666;
}
@media (max-width: 600px) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
styles.module.css
.section {
position: relative;
width: 100%;
aspect-ratio: var(--aspect-ratio, 16 / 9);
overflow: hidden;
background-color: #000;
}
.video {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.overlay {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2rem;
}
.title {
font-size: clamp(1.5rem, 3vw, 2.5rem);
font-weight: 700;
text-transform: uppercase;
color: #fff;
letter-spacing: -0.04em;
margin: 0;
}
.cta {
font-size: clamp(0.8rem, 0.95vw, 0.95rem);
font-weight: 700;
background-color: #000;
color: #fff;
border-radius: 8px;
border: 1px solid #fff;
padding: 0 2.5rem;
letter-spacing: -0.01em;
text-transform: uppercase;
text-decoration: none;
position: relative;
overflow: hidden;
height: 3.5rem;
display: flex;
align-items: center;
justify-content: center;
}
.cta:hover {
background-color: #383838;
border-color: transparent;
}
.ctaInner {
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.ctaDefault {
display: flex;
align-items: center;
justify-content: center;
transition: transform 500ms cubic-bezier(0.65, 0, 0, 1);
transform: translateY(0%);
}
.cta:hover .ctaDefault {
transform: translateY(-300%);
}
.ctaHover {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
transition: transform 500ms cubic-bezier(0.65, 0, 0, 1);
transform: translateY(250%);
transition-delay: 100ms;
}
.cta:hover .ctaHover {
transform: translateY(0%);
transition-delay: 100ms;
}
@media (max-width: 768px) {
.section { aspect-ratio: 4 / 3; }
}
@media (max-width: 465px) {
.section { aspect-ratio: 4 / 6; }
}
@media (max-width: 325px) {
.section { aspect-ratio: 4 / 8; }
}