跳转到内容
页面·免费

落地页首屏(Next.js + Tailwind)

用于 Next.js App Router 的首屏区块:柔和渐变背景上有标题、副标题和两个链接。系统处于深色模式时会使用深色配色。

免费安装。

如果你的 Android 设备上装了 PocketCode,这会在应用里打开此页面。

预览

Hero.tsx · 49 行
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>
  );
}

1.0.0 的变更

首个版本。

相关

价格区块(HTML + Tailwind)免费页面用纯 HTML 加 Tailwind CSS 4 类名写的三档价格方案,不用 React 也不用 JavaScript。卡片在手机上纵向排列,并跟随系统设置切换深色。你的项目需要 Tailwind 来生成样式;方案和价格只是示例,请替换。联系表单(HTML + CSS)免费页面单个 HTML 文件里的联系表单:姓名、邮箱、可选的主题和留言。每个字段都有自己的标签,只有在用户输入过或尝试提交后才会显示红色边框。把表单的 action 改成你的接收地址。深色模式跟随系统。404 页面(HTML + CSS)免费页面单个 HTML 文件的“页面未找到”页面。在静态网站里保存为 404.html。页面上有回到首页和报告失效链接的链接,有上一页时还会显示返回按钮。浅色或深色跟随系统设置。按钮(React + Tailwind)免费按钮TypeScript 按钮,提供主要和次要两种样式、清晰可见的焦点环,以及会同时设置 aria-busy 的加载圈。次要样式带有深色模式配色。登录界面(Compose)免费页面Material 3 的邮箱和密码登录界面。点按 Sign in 时检查两个输入框,显示服务器返回的错误,还可以加上“忘记密码”和指纹按钮。BiometricPrompt 需要你自己调用。Next.js + Tailwind + i18nPro项目模板Next.js 15 项目,带 next-intl 和 Tailwind CSS,在 /en 和 /es 提供一个英语和西班牙语页面。深色模式跟随系统。需要带 Node.js 的 Linux 环境;首次 npm install 约下载 400 MB。