Parallax Hero

Layout

Hero section with layered pixel parallax depth and stat blocks.

Import

import { PixelParallaxHero } from "@/components/ui/pixel/pixel-parallax-hero"

Usage

NEW

Retro Depth

Parallax Hero

Layered panels glide with your cursor to create true 8-bit immersion.

4
Layers
60
FPS
0ms
Latency

Retro Mode

Parallax

Move your cursor to explore depth

Component Source

Copy and paste the following code into your project at /src/components/ui/pixel/pixel-parallax-hero.tsx

"use client";

import Link from "next/link";
import * as React from "react";
import { PixelButton } from "@/components/ui/pixel/pixel-button";
import { cn } from "@/lib/utils";

export type PixelParallaxHeroShape = "square" | "circle" | "diamond" | "pill";

export interface PixelParallaxLayer {
  /** Size of the decorative layer in pixels */
  size?: number;
  /** Hex or rgba color */
  color?: string;
  /** Tailwind blur utility (e.g. blur-sm) */
  blurClassName?: string;
  /** 0-1 opacity */
  opacity?: number;
  /** Movement multiplier, higher = faster parallax */
  speed?: number;
  /** Extra class names for gradients/shadows */
  className?: string;
  /** Positioning within the hero canvas */
  position?: React.CSSProperties;
  /** Pixel-perfect shape */
  shape?: PixelParallaxHeroShape;
  /** Border color override */
  borderColor?: string;
}

export interface PixelParallaxHeroStat {
  label: string;
  value: string;
  hint?: string;
}

export interface PixelParallaxHeroAction {
  label: string;
  href?: string;
  icon?: React.ReactNode;
  variant?: "default" | "secondary" | "ghost" | "destructive";
  size?: "sm" | "md" | "lg";
  onClick?: () => void;
}

export interface PixelParallaxHeroProps
  extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
  badge?: React.ReactNode;
  title?: React.ReactNode;
  subtitle?: React.ReactNode;

// ... (more code below)

Props

PropTypeDefaultDescription
titleReact.ReactNode-Hero heading content
subtitleReact.ReactNode-Optional eyebrow text
primaryActionPixelParallaxHeroAction-Primary CTA button configuration
statsPixelParallaxHeroStat[]-Array of stat cards rendered below actions
layersPixelParallaxLayer[]-Custom decorative parallax layers
contentAlign"left" | "center""left"Align text content

Examples

Default Layout

NEW

Retro Depth

Parallax Hero

Layered panels glide with your cursor to create true 8-bit immersion.

4
Layers
60
FPS
0ms
Latency

Retro Mode

Parallax

Move your cursor to explore depth

Centered with Custom Stats

NEW

Retro Depth

Parallax Hero

Layered panels glide with your cursor to create true 8-bit immersion.

4
Layers
60
FPS
0ms
Latency

Retro Mode

Parallax

Move your cursor to explore depth

Accessibility

This component is built with accessibility in mind, including proper ARIA attributes, keyboard navigation, and focus management.