Skip to content
Page·Free

Landing hero (Next.js + Tailwind)

Hero section for the Next.js App Router: a title, a subtitle and two links over a soft gradient. It uses dark colours when the system is in dark mode.

Free to install.

If PocketCode is installed on your Android device, this opens the page in the app.

Preview

Hero.tsx · 49 lines
import Link from 'next/link';

// Hero section for a Next.js (App Router) landing page with Tailwind CSS.
// Dark mode follows Tailwind's `dark:` variant (the system setting by default).
// <Hero title="..." subtitle="..." ctaHref="/signup" />

type HeroProps = {
  title?: string;
  subtitle?: string;
  ctaLabel?: string;
  ctaHref?: string;
  secondaryLabel?: string;
  secondaryHref?: string;
};

const focusRing =
  'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600';

export default function Hero({
  title = 'Plan your week in five minutes',
  subtitle = 'Drop in your tasks, pick what matters today and get a plan you can follow. Works on your phone and your laptop.',
  ctaLabel = 'Start for free',
  ctaHref = '/signup',
  secondaryLabel = 'See how it works',
  secondaryHref = '#how-it-works',
}: HeroProps) {
  return (
    <section className="relative isolate overflow-hidden bg-gradient-to-b from-indigo-100 via-white to-white px-6 py-24 dark:from-indigo-950 dark:via-gray-950 dark:to-gray-950 sm:py-32">
      <div className="mx-auto max-w-2xl text-center">
        <h1 className="text-4xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-6xl">{title}</h1>
        <p className="mt-6 text-lg leading-8 text-gray-700 dark:text-gray-300">{subtitle}</p>
        <div className="mt-10 flex flex-col items-center justify-center gap-4 sm:flex-row sm:gap-6">
          <Link
            href={ctaHref}
            className={`w-full rounded-lg bg-indigo-600 px-6 py-3 text-base font-semibold text-white shadow-sm hover:bg-indigo-500 sm:w-auto ${focusRing}`}
          >
            {ctaLabel}
          </Link>
          <Link
            href={secondaryHref}
            className={`rounded-lg px-4 py-3 text-base font-semibold text-gray-900 hover:text-indigo-700 dark:text-white dark:hover:text-indigo-300 ${focusRing}`}
          >
            {secondaryLabel} <span aria-hidden="true">&rarr;</span>
          </Link>
        </div>
      </div>
    </section>
  );
}

Changes in 1.0.0

First version.

Related

Pricing section (HTML + Tailwind)FreePageThree pricing plans in plain HTML with Tailwind CSS 4 classes, with no React or JavaScript. The cards stack on phones and switch to dark colours with the system setting. Your project needs Tailwind to build the styles. Replace the example plans and prices with yours.Contact form (HTML + CSS)FreePageA contact form in one HTML file: name, email, an optional topic and the message. Every field has a label, and a red border appears only after someone types in it or tries to send. Set the form's action to your endpoint. Dark mode follows the system.404 page (HTML + CSS)FreePageA "page not found" page in one HTML file. Save it as 404.html on your static site. It links to your home page and to a page for reporting the broken link, and shows a back button when there is a previous page. Light or dark follows the system.Button (React + Tailwind)FreeButtonTypeScript button with primary and secondary styles, a visible focus ring and a loading spinner that also sets aria-busy. The secondary style has dark mode colours.Login screen (Compose)FreePageEmail and password screen in Material 3. It checks both fields when you tap Sign in, shows the error your server returns, and can add Forgot password and fingerprint buttons. You call BiometricPrompt yourself.Next.js + Tailwind + i18nProProject templateNext.js 15 project with next-intl and Tailwind CSS, and one page in English and Spanish at /en and /es. Dark mode follows the system. Needs the Linux environment with Node.js; the first npm install downloads around 400 MB.