Skip to content

Hero Section 10

Aurora hero on a dark canvas with drifting gradient blobs, word-by-word reveal, a self-drawing chart and three switchable colour palettes.

10 / 12

Installation

Run this in a project that already uses shadcn/ui. The CLI adds the block, its components and npm dependencies.

pnpm dlx shadcn@latest add https://ui.sumansharma.info.np/r/hero-section-10.json
Prefer to iterate with AI?Open in

Usage

The CLI writes the block to components/hero-section-10.tsx. Import it anywhere:

Loading...

Source

The CLI writes this component to components/hero-section-10.tsx.

'use client'

import { useState } from 'react'
import Link from 'next/link'
import { Instrument_Serif } from 'next/font/google'
import { motion, useReducedMotion, type Variants } from 'motion/react'
import { ArrowRight, Check, Play, TrendingUp, Users, Zap } from 'lucide-react'
import { cn } from '@/lib/utils'

const serif = Instrument_Serif({ subsets: ['latin'], weight: '400', style: 'italic' })

/** Three colour variants. Change DEFAULT_PALETTE, or remove the switcher at the bottom to lock one in. */
const palettes = {
    borealis: { name: 'Borealis', a: '#22d3a6', b: '#3b82f6', c: '#a3e635', ink: '#04130f' },
    ember: { name: 'Ember', a: '#fb7185', b: '#f97316', c: '#facc15', ink: '#1a0805' },
    lagoon: { name: 'Lagoon', a: '#38bdf8', b: '#818cf8', c: '#2dd4bf', ink: '#050b1a' },
} as const

type PaletteKey = keyof typeof palettes

const DEFAULT_PALETTE: PaletteKey = 'borealis'

const grain = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>")`

const headline = ['Build', 'products', 'people', 'actually']

const ease = [0.22, 1, 0.36, 1] as const

const word: Variants = {
    hidden: { opacity: 0, y: 24, filter: 'blur(10px)' },
    show: (i: number) => ({ opacity: 1, y: 0, filter: 'blur(0px)', transition: { delay: 0.15 + i * 0.08, duration: 0.8, ease } }),
}

const rise: Variants = {
    hidden: { opacity: 0, y: 20 },
    show: (delay: number) => ({ opacity: 1, y: 0, transition: { delay, duration: 0.8, ease } }),
}

export default function HeroSection() {
    const [key, setKey] = useState<PaletteKey>(DEFAULT_PALETTE)
    const p = palettes[key]
    const reduce = useReducedMotion()

    const drift = (x: number[], y: number[], duration: number) => (reduce ? {} : { animate: { x, y, scale: [1, 1.15, 1] }, transition: { duration, repeat: Infinity, ease: 'easeInOut' as const } })

    return (
        <section
            style={{ '--a': p.a, '--b': p.b, '--c': p.c, '--ink': p.ink } as React.CSSProperties}
            className="relative isolate min-h-screen overflow-hidden bg-[#05060f] text-white">
            {/* Aurora blobs */}
            <div
                aria-hidden
                className="absolute inset-0 -z-10">
                <motion.div
                    {...drift([0, 80, -40, 0], [0, 40, 80, 0], 18)}
                    className="absolute -left-40 -top-40 size-[38rem] rounded-full bg-[var(--a)] opacity-40 blur-[120px] transition-colors duration-1000"
                />
                <motion.div
                    {...drift([0, -60, 40, 0], [0, 60, -30, 0], 22)}
                    className="absolute -right-32 top-10 size-[32rem] rounded-full bg-[var(--b)] opacity-40 blur-[120px] transition-colors duration-1000"
                />
                <motion.div
                    {...drift([0, 50, -50, 0], [0, -40, 20, 0], 26)}
                    className="absolute bottom-[-12rem] left-1/3 size-[30rem] rounded-full bg-[var(--c)] opacity-25 blur-[120px] transition-colors duration-1000"
                />
                {/* Film grain */}
                <div
                    className="absolute inset-0 opacity-[0.18] mix-blend-overlay"
                    style={{ backgroundImage: grain }}
                />
                <div className="absolute inset-0 bg-[linear-gradient(to_bottom,transparent_60%,#05060f)]" />
            </div>

            <div className="mx-auto flex max-w-6xl flex-col items-center px-6 pb-20 pt-28 text-center md:pt-36">
                <motion.div
                    variants={rise}
                    custom={0}
                    initial="hidden"
                    animate="show">
                    <Link
                        href="#"
                        className="group relative inline-flex items-center gap-2 rounded-full p-px">
                        <span
                            aria-hidden
                            className="absolute inset-0 rounded-full bg-[conic-gradient(from_var(--angle),var(--a),var(--b),var(--c),var(--a))] opacity-80 motion-safe:animate-[hero10-spin_4s_linear_infinite]"
                        />
                        <span className="relative inline-flex items-center gap-2 rounded-full bg-[#0a0c18] px-4 py-1.5 text-sm text-white/80">
                            <span className="size-1.5 rounded-full bg-[var(--a)] shadow-[0_0_12px_var(--a)]" />
                            Introducing Pulse 3.0
                            <ArrowRight className="size-3.5 transition-transform group-hover:translate-x-0.5" />
                        </span>
                    </Link>
                </motion.div>

                <h1 className="mt-8 max-w-4xl text-balance text-5xl font-semibold leading-[1.02] tracking-[-0.04em] sm:text-7xl lg:text-[5.5rem]">
                    {headline.map((w, i) => (
                        <motion.span
                            key={w}
                            variants={word}
                            custom={i}
                            initial="hidden"
                            animate="show"
                            className="mr-[0.22em] inline-block">
                            {w}
                        </motion.span>
                    ))}
                    <motion.span
                        variants={word}
                        custom={headline.length}
                        initial="hidden"
                        animate="show"
                        className={cn(serif.className, 'inline-block bg-gradient-to-r from-[var(--a)] via-[var(--b)] to-[var(--c)] bg-clip-text pr-2 font-normal tracking-normal text-transparent')}>
                        love.
                    </motion.span>
                </h1>

                <motion.p
                    variants={rise}
                    custom={0.6}
                    initial="hidden"
                    animate="show"
                    className="mt-6 max-w-xl text-pretty text-lg text-white/65">
                    Pulse turns raw product signals into decisions. See what users do, why they churn, and what to ship next, all in one live workspace.
                </motion.p>

                <motion.div
                    variants={rise}
                    custom={0.75}
                    initial="hidden"
                    animate="show"
                    className="mt-10 flex flex-wrap justify-center gap-3">
                    <Link
                        href="#"
                        className="group inline-flex h-12 items-center gap-2 rounded-full bg-gradient-to-r from-[var(--a)] to-[var(--b)] px-6 font-medium text-[var(--ink)] shadow-[0_10px_40px_-10px_var(--a)] transition-[transform,box-shadow] hover:-translate-y-0.5 hover:shadow-[0_16px_50px_-10px_var(--a)]">
                        Start free trial
                        <ArrowRight className="size-4 transition-transform group-hover:translate-x-0.5" />
                    </Link>
                    <Link
                        href="#"
                        className="inline-flex h-12 items-center gap-2 rounded-full border border-white/15 bg-white/5 px-6 font-medium backdrop-blur transition-colors hover:bg-white/10">
                        <Play className="size-4 fill-current" />
                        Watch demo
                    </Link>
                </motion.div>

                <motion.ul
                    variants={rise}
                    custom={0.9}
                    initial="hidden"
                    animate="show"
                    className="mt-6 flex flex-wrap justify-center gap-x-6 gap-y-2 text-sm text-white/55">
                    {['14-day free trial', 'No credit card', 'Cancel anytime'].map((t) => (
                        <li
                            key={t}
                            className="flex items-center gap-1.5">
                            <Check className="size-3.5 text-[var(--a)]" />
                            {t}
                        </li>
                    ))}
                </motion.ul>

                {/* Product glass panel with floating chips */}
                <motion.div
                    initial={{ opacity: 0, y: 60, rotateX: 18 }}
                    animate={{ opacity: 1, y: 0, rotateX: 0 }}
                    transition={{ delay: 1, duration: 1.2, ease }}
                    style={{ transformPerspective: 1200 }}
                    className="relative mt-20 w-full max-w-4xl">
                    <div className="rounded-2xl border border-white/10 bg-white/[0.04] p-2 shadow-2xl shadow-black/50 backdrop-blur-xl">
                        <div className="rounded-xl border border-white/10 bg-[#0a0c18]/80 p-5 text-left sm:p-6">
                            <div className="flex items-center justify-between">
                                <p className="text-sm text-white/60">Weekly active users</p>
                                <span className="rounded-full bg-[var(--a)]/15 px-2.5 py-0.5 text-xs font-medium text-[var(--a)]">+24.8%</span>
                            </div>
                            <p className="mt-1 text-3xl font-semibold tracking-tight">48,291</p>
                            <svg
                                viewBox="0 0 600 140"
                                className="mt-4 h-28 w-full sm:h-36"
                                aria-hidden>
                                <defs>
                                    <linearGradient
                                        id="hero10-fill"
                                        x1="0"
                                        x2="0"
                                        y1="0"
                                        y2="1">
                                        <stop
                                            offset="0%"
                                            stopColor="var(--a)"
                                            stopOpacity=".35"
                                        />
                                        <stop
                                            offset="100%"
                                            stopColor="var(--a)"
                                            stopOpacity="0"
                                        />
                                    </linearGradient>
                                    <linearGradient
                                        id="hero10-line"
                                        x1="0"
                                        x2="1">
                                        <stop
                                            offset="0%"
                                            stopColor="var(--b)"
                                        />
                                        <stop
                                            offset="100%"
                                            stopColor="var(--a)"
                                        />
                                    </linearGradient>
                                </defs>
                                <motion.path
                                    d="M0 120 C60 110 90 80 150 88 S240 40 300 60 S400 20 460 34 S560 10 600 6 L600 140 L0 140Z"
                                    fill="url(#hero10-fill)"
                                    initial={{ opacity: 0 }}
                                    animate={{ opacity: 1 }}
                                    transition={{ delay: 2, duration: 1 }}
                                />
                                <motion.path
                                    d="M0 120 C60 110 90 80 150 88 S240 40 300 60 S400 20 460 34 S560 10 600 6"
                                    fill="none"
                                    stroke="url(#hero10-line)"
                                    strokeWidth="3"
                                    strokeLinecap="round"
                                    initial={{ pathLength: 0 }}
                                    animate={{ pathLength: 1 }}
                                    transition={{ delay: 1.4, duration: 1.6, ease: 'easeInOut' }}
                                />
                            </svg>
                        </div>
                    </div>

                    <FloatingChip
                        className="-left-4 top-8 hidden sm:flex lg:-left-16"
                        delay={1.8}
                        icon={Users}
                        label="New signups"
                        value="1,204"
                        reduce={reduce}
                    />
                    <FloatingChip
                        className="-right-4 bottom-10 hidden sm:flex lg:-right-14"
                        delay={2}
                        icon={TrendingUp}
                        label="Retention"
                        value="92%"
                        reduce={reduce}
                        offset={1.5}
                    />
                    <FloatingChip
                        className="-top-6 right-16 hidden md:flex"
                        delay={2.2}
                        icon={Zap}
                        label="Events / sec"
                        value="3.2k"
                        reduce={reduce}
                        offset={0.8}
                    />
                </motion.div>
            </div>

            {/* Palette switcher: demo of the colour variants */}
            <div
                role="radiogroup"
                aria-label="Colour palette"
                className="absolute bottom-5 right-5 flex items-center gap-1.5 rounded-full border border-white/10 bg-black/40 p-1.5 backdrop-blur">
                {(Object.keys(palettes) as PaletteKey[]).map((k) => (
                    <button
                        key={k}
                        type="button"
                        role="radio"
                        aria-checked={k === key}
                        aria-label={palettes[k].name}
                        title={palettes[k].name}
                        onClick={() => setKey(k)}
                        style={{ background: `linear-gradient(135deg, ${palettes[k].a}, ${palettes[k].b})` }}
                        className={cn('size-6 rounded-full ring-offset-2 ring-offset-black transition-transform hover:scale-110', k === key && 'ring-2 ring-white')}
                    />
                ))}
            </div>

            <style>{`
                @property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
                @keyframes hero10-spin { to { --angle: 360deg; } }
            `}</style>
        </section>
    )
}

function FloatingChip({ className, delay, icon: Icon, label, value, reduce, offset = 0 }: { className?: string; delay: number; icon: React.ElementType; label: string; value: string; reduce: boolean | null; offset?: number }) {
    return (
        <motion.div
            initial={{ opacity: 0, scale: 0.8 }}
            animate={{ opacity: 1, scale: 1 }}
            transition={{ delay, type: 'spring', stiffness: 200, damping: 18 }}
            className={cn('absolute items-center gap-3 rounded-2xl border border-white/10 bg-[#0d1020]/80 px-4 py-3 shadow-xl backdrop-blur-xl', className)}>
            <motion.div
                className="flex items-center gap-3"
                animate={reduce ? undefined : { y: [0, -8, 0] }}
                transition={{ duration: 4, repeat: Infinity, ease: 'easeInOut', delay: offset }}>
                <span className="flex size-9 items-center justify-center rounded-xl bg-gradient-to-br from-[var(--a)] to-[var(--b)] text-[var(--ink)]">
                    <Icon className="size-4" />
                </span>
                <span className="text-left">
                    <span className="block text-xs text-white/50">{label}</span>
                    <span className="block font-semibold">{value}</span>
                </span>
            </motion.div>
        </motion.div>
    )
}