Hero Section
Hero banner section
Overview
HeroSection renders the primary above-the-fold section of a marketing page. Choose from four variant layouts:
- centered — headline and CTAs horizontally centered, optional content slot below.
- split — two-column layout with text on the left and an image on the right.
- video — full-bleed background video with centered overlay content (forces dark mode).
- gradient — centered layout with a custom CSS gradient layer behind the content.
Usage
import { HeroSection } from '@leanicon/web-builder-library'
;<HeroSection
variant="centered"
headline="Build faster with great UI"
subtext="Production-ready React components."
primaryCTA={{ label: 'Get started', href: '/signup' }}
secondaryCTA={{ label: 'View docs', href: '/docs' }}
/>Variants
Centered
Build faster with great UI
A collection of production-ready React components styled with Tailwind CSS.
With badge
Introducing web-builder-library v2
Everything you need to ship beautiful marketing pages.
Split (with image)
Pass any element as children to render in the right column of the split layout.
Ship marketing pages in minutes
Composable blocks, dark mode ready, and accessible out of the box.
Split (with custom content)
The children slot accepts any element — not just images.
10x
Faster development
Video background
The video variant automatically enables dark mode. Provide a looping background video via videoSrc.
Gradient
Pass one of the named section bands to background. It renders as an aria-hidden overlay behind the content.
Inside a page you do not set this: RenderBlocks paints the band on the block wrapper from the editor's Section background choice, and enforces the rule that two gradients never sit next to each other.
Dark color scheme
Primary CTA only
Ready to get started?
Animated background (aurora)
Use the backgroundSlot prop to layer an AnimatedBackground behind the content. Color presets adapt the palette instantly.
Animated background (grid)
The spotlight orbits freely, follows the cursor on hover, and resumes its orbit when the cursor leaves.
Animated background (particles)
Notes
- In
splitvariant,childrenrender in the right column (media slot). In other variants,childrenrender below the headline and CTAs. - The
imageprop still works as a shorthand for split — if nochildrenare provided, it renders the image in the right column. - The
videovariant always renders inside a<div class="dark">regardless ofcolorScheme. - The section is wrapped in
<section aria-label="Hero">for landmark navigation. - Prefer the dark bands (
grad-ink-brand,grad-deep) behind light hero copy. Notegrad-deepwill not carry muted text —ink-400on it is only 3.26:1. - All four variants are fully responsive — single column on mobile, multi-column on
lgbreakpoint.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
variant | enum | — | Yes | |
badge | string | — | No | |
headline | string | — | Yes | |
subtext | string | — | No | |
primaryCTA | CTAButton | — | No | |
secondaryCTA | CTAButton | — | No | |
image | ImageProps | — | No | |
videoSrc | string | — | No | |
background | enum | — | No | A named section band, for standalone use (stories, the showcase, the published library). Inside a page the adapter does NOT pass this — RenderBlocks paints the band on the block wrapper, so setting it here too would draw the same gradient twice. Replaces a free-text `gradientClass`, which interpolated an arbitrary CMS string straight into `cn()`. |
backgroundSlot | ReactNode | — | No | |
animation | HeroSectionAnimation | — | No | |
colorScheme | enum | — | No | |
className | string | — | No | |
headingLevel | enum | — | No | Heading level for the headline (spec 007, Research D7). Defaults to h1 — the hero is the de-facto page title on blocks-only pages. Pages that render their own <h1> above the blocks pass headingContext="section" to RenderBlocks, which demotes this to h2. |
cta | CTAButton | — | Yes |