Hero

Thin two-tone headline, two buttons, ticks, and one framed piece of media over the glow.

NewMarkdown output for AI agents

The screenshot API for developers. Any URL to image, PDF or markdown in one call.

  • 200 free screenshots
  • No credit card
northwind.io

Install

$ npx shadcn@latest add @nudgekit/hero

Or with no config: npx shadcn@latest add https://ui.nudgekit.app/r/hero.json

Brings in @nudgekit/button, @nudgekit/tone, @nudgekit/glow, @nudgekit/viewfinder, lucide-react, and the theme.

Usage

usage.tsx
import { Hero } from "@/components/hero"

<Hero
  announcement={{ tag: "New", text: "Markdown output for AI agents" }}
  title="The screenshot API for developers."
  tone="Any URL to image, PDF or markdown in one call."
  primary={{ label: "Start for free", href: "/signup" }}
  secondary={{ label: "Read the docs", href: "/docs" }}
  ticks={["200 free screenshots a month", "No credit card"]}
  media={<BrowserFrame url="northwind.io">…</BrowserFrame>}
/>

Do

  • Show the real product as the media.
  • Keep ticks to three or fewer.

Don't

  • Float extra cards or badges around the media.
  • Bold the headline.

Code

What the CLI writes into your project. It is yours to change.

components/hero.tsx
import * as React from "react";
import { ArrowRight, Check } from "lucide-react";

import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
import { Tone } from "@/components/ui/tone";
import { Glow } from "@/components/glow";
import { Viewfinder } from "@/components/viewfinder";

export interface HeroProps {
  /** Small pill above the headline, for example { tag: "New", text: "Markdown output for AI agents" }. */
  announcement?: { tag: string; text: string; href?: string };
  /** The first, navy sentence of the headline. */
  title: string;
  /** The grey second half. */
  tone?: string;
  primary: { label: string; href: string };
  secondary?: { label: string; href: string };
  /** Up to three short reassurances under the buttons. */
  ticks?: string[];
  /** The one piece of media on the right. It gets the viewfinder corners. */
  media: React.ReactNode;
  className?: string;
}

/** Medium two-tone headline on the left, one framed piece of media on the right, soft glow behind. */
function Hero({ announcement, title, tone, primary, secondary, ticks, media, className }: HeroProps) {
  const Pill = announcement?.href ? "a" : "div";
  return (
    <section data-slot="hero" className={cn("relative overflow-hidden border-b border-border", className)}>
      <Glow dots />
      <div className="relative mx-auto grid max-w-[1120px] items-center gap-14 px-6 pb-20 pt-14 lg:grid-cols-[1.05fr_1fr]">
        <div>
          {announcement && (
            <Pill
              {...(announcement.href ? { href: announcement.href } : {})}
              className="mb-6 inline-flex items-center gap-2.5 rounded-full border border-border bg-background/75 py-1 pl-1 pr-3 text-[13px] text-muted-foreground"
            >
              <span className="rounded-full bg-brand-tint px-2.5 py-0.5 text-xs font-medium text-brand-ink">{announcement.tag}</span>
              {announcement.text}
              <span aria-hidden>›</span>
            </Pill>
          )}
          <h1 className="headline mb-7 text-[clamp(2rem,4vw,2.75rem)]">
            {title} {tone && <Tone>{tone}</Tone>}
          </h1>
          <div className="flex flex-wrap items-center gap-3">
            <a href={primary.href} className={buttonVariants()}>
              {primary.label}
              <ArrowRight aria-hidden className="size-4 transition-transform duration-150 group-hover:translate-x-0.5 motion-reduce:transition-none" />
            </a>
            {secondary && (
              <a href={secondary.href} className={buttonVariants({ variant: "secondary" })}>
                {secondary.label}
              </a>
            )}
          </div>
          {ticks && ticks.length > 0 && (
            <ul className="mt-5 flex flex-wrap gap-x-5 gap-y-2 text-[13px] text-muted-foreground">
              {ticks.map((t) => (
                <li key={t} className="inline-flex items-center gap-1.5">
                  <Check aria-hidden className="size-3.5 text-brand" />
                  {t}
                </li>
              ))}
            </ul>
          )}
        </div>
        <Viewfinder>{media}</Viewfinder>
      </div>
    </section>
  );
}

export { Hero };