React Dark Hero Section with a CSS Spotlight Beam and Grain
ProA near black hero with one diagonal shaft of grey green light falling across it, softened by film grain and a vignette at the edges. A large headline fades from white to translucent, and everything else, an eyebrow, a paragraph, buttons and a scrolling logo row, appears only when you ask for it.

Light, grain and nothing else
Hero Section with Spotlight Beam is a React and Tailwind CSS dark hero section whose background is a spotlight effect made in pure CSS: an angled linear gradient for the beam, a radial vignette and an SVG noise texture for grain. It runs in Next.js or any React app and loads no images.
Spotlight backgrounds are often built with canvas, blur filters or large PNGs. Here the beam is a single 115 degree gradient from black to a muted sage, which the grain breaks up enough to feel photographic. The result paints with the stylesheet and costs nothing to animate because nothing animates.
The block is deliberately minimal by default. Only the headline has default text; the eyebrow, paragraph, two buttons and the trust row stay out of the page until you pass them, so you build up exactly the hero you need.
What the beam is made of
Diagonal beam
A linear gradient at 115 degrees from #030404 to #768a89, producing a soft shaft of light that crosses the section.
Vignette
A radial gradient darkens the corners and focuses the light on the copy.
Film grain
An inline SVG fractal noise texture in a data URI, blended with overlay at 35 percent, so there is no image request.
Gradient headline
Sized with container query units, capped at 18 characters per line, and filled from white to 40 percent white so it fades into the light.
Optional extras
An eyebrow with a pulsing dot, a paragraph, a primary button whose white fill slides up on hover, a secondary button, and a 40 second logo marquee that appears only when trustLabel is set.
Good fit, poor fit
Use it when
- Dark, editorial brands in health, science, finance or AI that want restraint.
- You want a hero that paints instantly with no images, canvas or animation library.
- A single strong headline is your message and you want space around it.
- You need an accent colour for one button and one eyebrow, set by a single prop.
Skip it when
- Your site is light themed; the block is drawn for dark only.
- You need a product screenshot in the hero.
- Scrolling logo rows are against your design rules.
- You want the beam to move or follow the cursor. It is static by design.
Build it up from the headline
Start with headline and add pieces as you need them: eyebrow for a short label above it, subtext for the paragraph, primaryCta and secondaryCta for buttons, and trustLabel plus partnerBrands for a scrolling row of logos. accentColor tints the eyebrow dot and the primary button, lime by default.
To change the beam, edit the 115deg gradient stops at the top of the component. Swapping the sage for a cool blue or a warm amber changes the whole mood while the grain and vignette keep it photographic.
npx wensity@latest add hero-section-with-spotlight-beam --type block
import { SolaceHero } from "@/components/wensity/blocks/hero-section-with-spotlight-beam";export default function Page() {return (<SolaceHeroeyebrow="Clinical grade, at home"headline={"Sleep data your\ndoctor can use"}subtext="Restwell turns a night of readings into a one page report you can share."primaryCta={{ label: "Order a kit", href: "/order" }}secondaryCta={{ label: "How it works", href: "/how" }}accentColor="#a5f3fc"/>);}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
headline | string | "We measure what\nmatters for better health" | The only text with a default. Newlines split the lines. |
eyebrow | string | - | Short label with a pulsing dot above the headline. Omitted when unset. |
subtext | string | - | Paragraph under the headline. Omitted when unset. |
primaryCta / secondaryCta | { label: string; href: string } | - | Buttons, each rendered only when passed. |
trustLabel | string | - | Turns on the logo marquee and labels it. |
accentColor | string | "#c8e645" | Colour of the eyebrow dot and the primary button. |
Weight, motion and contrast
Zero image requests
Beam, vignette and grain are CSS gradients and an inline SVG. The hero is styled before any JavaScript runs.
Two infinite animations
The eyebrow dot pulses and the logo marquee scrolls forever, and neither checks reduced motion. Add motion-reduce:animate-none to both.
Marquee duplicates
The partner list is rendered three times for a seamless loop. Mark the copies aria-hidden so screen readers hear each name once.
Accent contrast
The lime default is light, so the primary button uses dark text. If you pick a darker accent, check that the label still reads.
Block details
- Category
- Hero Sections
- Renders
- CSS only. Paints as soon as the stylesheet arrives
- Theme
- Fixed dark surface. No light variant
- Dependencies
clsxtailwind-merge- Source
- 262 lines, 11 KB in one file
- Install
wensity add hero-section-with-spotlight-beam --type block- Tags
- dark, diagonal, spotlight, bold, minimalist, health
- Last updated

