Library MCP Setup About Template Factory ↗
← Library / Hero UI SDK Agentic

Spotlight Hero Card

Focused product hero section with UI SDK Button actions and a copy-command Toggle so agents can discover and trigger the primary CTA cleanly.

Install UI SDK & packages

npm install @ui-sdk/react @ui-sdk/core lucide-react

Give your agent the UI SDK skill

npx skills add vercel-labs/ui --skill ui-sdk

UI SDK entries: @ui-sdk/react/button @ui-sdk/react/toggle
"use client";

import * as React from "react";
import { ArrowRight, Check, Copy, Play } from "lucide-react";
import { Button } from "@ui-sdk/react/button";
import { Toggle } from "@ui-sdk/react/toggle";

export function SpotlightHeroCard({
  headline = "Ship agentic React UI without rebuilding basics",
  subcopy = "Every interactive part uses UI SDK behaviors with named controls, keyboard navigation, and Tailwind styling out of the box.",
  installCommand = "npm install @ui-sdk/react @ui-sdk/core",
  onPrimary,
  onSecondary,
}: {
  headline?: string;
  subcopy?: string;
  installCommand?: string;
  onPrimary?: () => void;
  onSecondary?: () => void;
}) {
  const [copied, setCopied] = React.useState(false);

  const handleCopyToggle = (pressed: boolean) => {
    setCopied(pressed);
    if (pressed && typeof navigator !== "undefined" && navigator.clipboard) {
      navigator.clipboard.writeText(installCommand).catch(() => {});
    }
  };

  return (
    <section className="relative overflow-hidden rounded-3xl border border-border bg-card px-6 py-16 text-center shadow-2xl sm:px-12">
      <h1 className="mx-auto max-w-2xl text-balance text-4xl font-extrabold tracking-tight text-foreground sm:text-5xl">
        {headline}
      </h1>
      <p className="mx-auto mt-4 max-w-xl text-base leading-relaxed text-muted-foreground">
        {subcopy}
      </p>
      <div className="mt-8 flex flex-wrap items-center justify-center gap-3">
        <Button
          onClick={onPrimary}
          className="inline-flex h-11 cursor-pointer items-center gap-2 rounded-xl bg-sky-400 px-6 text-sm font-bold text-slate-950 transition hover:bg-sky-300"
        >
          Get started free
          <ArrowRight className="h-4 w-4" aria-hidden="true" />
        </Button>
        <Button
          onClick={onSecondary}
          className="inline-flex h-11 cursor-pointer items-center gap-2 rounded-xl border border-border bg-secondary px-5 text-sm font-semibold text-foreground transition hover:border-sky-400/50"
        >
          <Play className="h-4 w-4 text-sky-400" aria-hidden="true" />
          Watch live demo
        </Button>
      </div>
      <div className="mt-6 flex justify-center">
        <Toggle
          aria-label="Copy install command"
          pressed={copied}
          onPressedChange={handleCopyToggle}
          className="inline-flex cursor-pointer items-center gap-2.5 rounded-xl border border-border bg-background/80 px-4 py-2 font-mono text-xs text-sky-300 transition data-pressed:border-emerald-400/60 data-pressed:text-emerald-300"
        >
          <span>{installCommand}</span>
          {copied ? <Check className="h-3.5 w-3.5" aria-hidden="true" /> : <Copy className="h-3.5 w-3.5" aria-hidden="true" />}
        </Toggle>
      </div>
    </section>
  );
}

export default SpotlightHeroCard;