The fullscreen hero layout creates an immersive first impression with full-viewport imagery, precise overlay control, and cinematic visual hierarchy.
Every fullscreen hero image needs an overlay to guarantee text readability. Choose based on image complexity and brand tone.
Active overlay
Body text remains readable against any overlay variant.
Tailwind class
bg-black/50Best for
50% black. Safe default for any image complexity.
A fullscreen hero is built from five z-indexed layers. Getting this order wrong is the most common mistake — nav disappears or overlay covers content.
Scroll indicator
absolute bottom-8 left-1/2 -translate-x-1/2Navigation (z-50)
absolute top-0 left-0 right-0 z-50Content (z-10)
relative z-10 flex items-center justify-centerOverlay layer
absolute inset-0 gradient or solidBackground image / video
absolute inset-0 object-coverCritical: Content must use relative z-10not absolute— so it participates in normal flow and stacks correctly above the overlay. Navigation usesz-50to stay on top of everything.
Three valid approaches — each with real-world trade-offs. Pick based on brand, bandwidth, and device targets.
Advantages
Trade-offs
Code snippet
<img src="/hero.jpg" alt="" className="absolute inset-0 w-full h-full object-cover" />Four named aiRules from the style definition. Every demo below is interactive — hover or press to feel the exact behavior on a dark overlay surface.
Resting: shadow-[0_4px_14px_rgba(0,0,0,0.3)]
Hover: hover:-translate-y-1
Hover: hover:shadow-[0_8px_28px_rgba(0,0,0,0.5)]
Active: active:scale-[0.98] active:translate-y-0
Active: active:shadow-[0_2px_8px_rgba(0,0,0,0.3)]
Focus: focus:ring-2 focus:ring-white/80
Focus: focus:ring-offset-2 focus:ring-offset-black/50
Hover the button to see gravity float + shadow burst.
Required: group class on card container
Hover: hover:-translate-y-2
Hover: hover:shadow-[0_16px_40px_rgba(0,0,0,0.5)]
Icon: group-hover:scale-110
Icon: transition-transform duration-300 ease-out
Brief feature description text.
Hover the card — group class triggers icon scale + text reveal simultaneously.
h3 resting: text-white/90
h3 hover: group-hover:text-white/95
p resting: text-white/70
p hover: group-hover:text-white/85
Both: transition-colors duration-200
End-to-end encryption on every request.
Hover to see h3 + p brighten from 90%/70% to 95%/85%.
All buttons: active:scale-[0.98]
Primary CTA: active:translate-y-0
Primary CTA: active:shadow-[0_2px_8px_rgba(0,0,0,0.3)]
Ghost CTA: active:translate-y-0
Duration: 200ms ease-out everywhere
Reason: dark overlay kills haptic cues
Hold either button — active:scale-[0.98] simulates physical depression on dark overlay.
Feature cards in a fullscreen hero use the Floating Glass pattern — glass surface, dramatic lift, icon micro-scale all driven by the parent group class.
Sub-100ms response times globally.
E2E encryption on every request.
200+ edge nodes worldwide.
Handles any traffic spike instantly.
All five official components from the style definition. Copy the code and drop it directly into your hero section.
<section className="relative min-h-screen flex items-center justify-center overflow-hidden">
{/* Background */}
<div className="absolute inset-0">
<img src="/hero-bg.jpg" alt="" className="w-full h-full object-cover" />
<div className="absolute inset-0 bg-black/50" />
<div className="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/30" />
</div>
{/* Navigation */}
<nav className="absolute top-0 left-0 right-0 z-50 px-6 py-6 flex items-center justify-between">
<a href="/" className="text-white text-2xl font-bold">Logo</a>
<div className="hidden md:flex items-center gap-8">
<a href="#" className="text-white/80 hover:text-white transition-colors">Features</a>
<button className="px-6 py-2 bg-white text-black rounded-full font-medium
hover:bg-white/90 hover:-translate-y-0.5
active:scale-[0.98] transition-all duration-200 ease-out">
Sign Up
</button>
</div>
</nav>
{/* Content */}
<div className="relative z-10 text-center px-4 max-w-4xl mx-auto">
<span className="inline-block px-4 py-2 bg-white/10 backdrop-blur-sm
rounded-full text-white/90 text-sm font-medium mb-6">
Announcing our product
</span>
<h1 className="text-5xl md:text-7xl font-bold text-white mb-6 leading-tight">
Build Something Amazing
</h1>
<p className="text-xl text-white/80 mb-10 max-w-2xl mx-auto">
The platform that creates incredible experiences users will love.
</p>
<div className="flex flex-col sm:flex-row gap-4 justify-center">
<button className="
px-8 py-4 bg-white text-black font-semibold text-lg rounded-full
shadow-[0_4px_14px_rgba(0,0,0,0.3)]
hover:bg-white/95 hover:-translate-y-1
hover:shadow-[0_8px_28px_rgba(0,0,0,0.5)]
focus:outline-none focus:ring-2 focus:ring-white/80
focus:ring-offset-2 focus:ring-offset-black/50
active:scale-[0.98] active:translate-y-0
active:shadow-[0_2px_8px_rgba(0,0,0,0.3)]
transition-all duration-200 ease-out
">Get Started Free</button>
<button className="
px-8 py-4 bg-transparent text-white font-semibold text-lg
rounded-full border-2 border-white
hover:bg-white/15 hover:-translate-y-1
hover:shadow-[0_8px_28px_rgba(0,0,0,0.3)]
focus:outline-none focus:ring-2 focus:ring-white/60
focus:ring-offset-2 focus:ring-offset-black/50
active:scale-[0.98] active:translate-y-0
transition-all duration-200 ease-out
">Watch Demo</button>
</div>
</div>
{/* Scroll indicator */}
<div className="absolute bottom-8 left-1/2 -translate-x-1/2
flex flex-col items-center gap-2 text-white/70 animate-bounce">
<span className="text-sm">Scroll to explore</span>
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2}
d="M19 14l-7 7m0 0l-7-7m7 7V3" />
</svg>
</div>
</section>Fullscreen Hero is a high-impact pattern — misuse destroys credibility instantly. These rules are drawn directly from the style definition.
You have under 2 seconds
Fullscreen heroes get one job: grab attention before the visitor decides to leave. Every pixel fights for that outcome. No waste. No decoration for its own sake.
Contrast is non-negotiable
Any image that fails WCAG AA without an overlay is the wrong image choice. The overlay is not cosmetic — it is load-bearing infrastructure for usability.
Subtle is the operative word
Ken Burns slow zoom, smooth entry animations, gentle scroll indicators. Anything that vibrates or flashes without purpose is strictly forbidden in this layout.
Fullscreen Hero is a layout — it pairs with a visual style for complete identity. It also must adapt gracefully across viewport sizes.
Responsive breakpoints
Mobile (< 768px)
Tablet (768px – 1280px)
Desktop (> 1280px)
Compatible visual styles
Glassmorphism
Frosted glass cards float directly over the hero image
Modern Gradient
Gradient fills become the background itself — no photo needed
Cyberpunk Neon
Neon glow typography on the deep dark canvas
Minimalist Flat
Clean bold type over subtle gradient backgrounds
Dark Mode
Natural fit — dark overlays are already dark mode