VisorVisor
Blocks

Hero Section

A full-width hero section with background media, heading, subheading, and call-to-action button.

Preview

Build Beautiful Interfaces

A design system built for real projects — theme-agnostic, copy-and-own, and production-ready.

Get Started Free

Installation

npx visor add --block hero-section

This copies files into your project:

  • blocks/hero-section/hero-section.tsx — the block component
  • blocks/hero-section/hero-section.module.css — the styles

Usage

import { HeroSection } from '@/blocks/hero-section/hero-section';

export default function HomePage() {
  return (
    <HeroSection
      heading="Build Beautiful Interfaces"
      subheading="A design system built for real projects."
      buttonText="Get Started Free"
      buttonHref="/start"
    />
  );
}

With image background

<HeroSection
  heading="Launch Something Great"
  subheading="Everything you need to ship fast."
  buttonText="Start Building"
  buttonHref="/start"
  backgroundImage="/images/hero-bg.jpg"
/>

With video background

<HeroSection
  heading="The Future of Design Systems"
  subheading="Theme-agnostic components that scale with your team."
  buttonText="Explore Visor"
  buttonHref="/docs"
  backgroundVideo="/videos/hero-loop.mp4"
  overlay={true}
/>

With children slot

<HeroSection
  heading="Build Beautiful Interfaces"
  subheading="Trusted by design teams worldwide."
  buttonText="Get Started"
>
  <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', justifyContent: 'center' }}>
    <Badge>Open Source</Badge>
    <Badge>WCAG 2.1 AA</Badge>
    <Badge>Copy & Own</Badge>
  </div>
</HeroSection>

Background Modes

The hero section supports three background modes, applied in priority order:

ModePropBehavior
VideobackgroundVideoRenders an autoPlay muted loop playsInline <video> element behind content. Takes priority over backgroundImage.
ImagebackgroundImageApplied as a CSS background-image on the root element with cover and center.
None(omit both)Section uses var(--surface-page) background and var(--text-primary) for text.

When media is present, the component applies var(--text-inverse) for text color and optionally renders a semi-transparent overlay using var(--overlay-bg).

Props

PropTypeDefaultDescription
headingstringRequired. The main hero heading.
subheadingstringSupporting subtitle rendered below the heading.
buttonTextstringLabel for the CTA button. Omit to render no button.
buttonHrefstringIf provided, renders the button as an <a> tag with this href.
onButtonClick() => voidClick handler for the button when no buttonHref is set.
backgroundImagestringURL for CSS background image. Ignored when backgroundVideo is set.
backgroundVideostringURL for a video background element. Takes priority over backgroundImage.
overlaybooleantrueWhen true and media is present, adds a translucent overlay using var(--overlay-bg).
classNamestringAdditional CSS class applied to the root <section> element.
childrenReactNodeCustom content rendered below the heading/subheading area (badges, logos, secondary buttons).

About Blocks

Blocks are complete UI patterns made up of multiple Visor components. Unlike individual components, blocks represent larger, composed sections of UI — such as hero sections, feature grids, or login forms.

Blocks are copy-and-own, just like components. Install them into your project and customize freely.