MenuClose

Hero Starfield Split — React Hero Section

Drop-in split hero: copy left, a badge wall in frosted chips right, so the twinkling star grid reads as the trust-panel backdrop.

View source
PreviewWEBGPU
Starting live preview

Usage

import { HeroStarfieldSplit } from "@/components/HeroStarfieldSplit";

export function Landing() {
  return (
    <section style={{ height: "max(640px, 100svh)" }}>
      <HeroStarfieldSplit
        title="Your next big idea."
        subtitle="Replace this with your own story."
        primaryCta={{ label: "Get started", href: "/start" }}
        secondaryCta={null}
        interactive
        {...{
          interactive: true,
          title: "Every launch,\nplotted in stars.",
          subtitle: "A hashed star grid with twinkle and parallax drift on the right of your copy — the space-tech look without the space-program budget."
        }}
      />
    </section>
  );
}
Implementation notes & API

Purpose: drop-in hero section — a full first screen with real, selectable DOM text (split layout) over a GPU starfield background. Copy it, ship it. Mount: give the parent an explicit height (e.g. height: 100dvh or a min-height); the shell fills it and clamps its own type with container queries. Props: eyebrow, title, subtitle, primaryCta, secondaryCta, badges, scheme ("dark" | "light"), accent, plus the starfield shader uniforms. Default copy is for demonstration. Supply your own content and CTA href or onClick; children replaces the content stack. Interaction: the starfield background animates on its own; text and CTAs are plain DOM (WCAG AA scrim, screen-reader readable). Guardrails: WebGPU required with graceful degradation; SSR renders inert DOM; prefers-reduced-motion freezes the shader and skips the entrance animation. Do not stack two heroes on one screen.

PropertyTypeNotes / default
title / subtitleReactNodeYour content; named heroes include example copy
eyebrowstringOptional short label
primaryCta / secondaryCtastring | HeroCta | null{ label, href } or { label, onClick }; null hides the action
childrenReactNodeReplaces the entire default content stack
interactivebooleanfalse in the library; enabled in this preview
scheme"dark" | "light"dark
className / stylestring / CSSPropertiesApplied to the hero section
fallbackReactNodeContent shown if the background renderer is unavailable
View source on GitHubFree for commercial projects · MIT