{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spotlight-tour-demo",
  "type": "registry:block",
  "title": "Spotlight Tour: Product Onboarding",
  "description": "Product Tour Overlay example, Product Onboarding: A first tour of a dashboard: the avatar, the toolbar, the New button and the sidebar. The hole goes from a circle to a long pill to a button to a tall panel. Clicking New moves the tour on. A take on the product tour (walkthrough) and tooltip (popover). Fits onboarding, changelog and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "onboarding",
    "changelog",
    "app-ui",
    "product-tour",
    "tooltip",
    "overlay",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/spotlight-tour#spotlight-tour-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/spotlight-tour.json"
  ],
  "files": [
    {
      "path": "components/spotlight-tour-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport { SpotlightTour, type SpotlightTourStep } from \"@/components/ui/spotlight-tour\";\n\nconst steps: SpotlightTourStep[] = [\n  {\n    target: \"[data-tour=avatar]\",\n    title: \"Your profile\",\n    body: \"Switch accounts, change your theme and manage billing from here.\",\n  },\n  {\n    target: \"[data-tour=toolbar]\",\n    title: \"Quick actions\",\n    body: \"Search, your inbox and help. Everything you reach for daily, one click away.\",\n  },\n  {\n    target: \"[data-tour=new]\",\n    title: \"Create a project\",\n    body: \"Start from scratch or from a template. Click New to try it.\",\n    advanceOnClick: true,\n  },\n  {\n    target: \"[data-tour=sidebar]\",\n    title: \"Your workspace\",\n    body: \"Projects, deployments and settings all live here. That's the whole tour.\",\n  },\n];\n\nconst glyph = (d: string) => (\n  <svg aria-hidden viewBox=\"0 0 24 24\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d={d} />\n  </svg>\n);\n\nconst nav = [\n  { label: \"Projects\", icon: glyph(\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z\") },\n  { label: \"Deployments\", icon: glyph(\"M13 2 3 14h9l-1 8 10-12h-9l1-8z\") },\n  { label: \"Analytics\", icon: glyph(\"M4 20V10M10 20V4M16 20v-7M22 20H2\") },\n  { label: \"Domains\", icon: glyph(\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18\") },\n  { label: \"Settings\", icon: glyph(\"M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1M15 4v4M9 10v4M17 16v4\") },\n];\n\nconst tools = [\n  { label: \"Search\", icon: glyph(\"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14ZM20 20l-3.5-3.5\") },\n  { label: \"Inbox\", icon: glyph(\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0\") },\n  { label: \"Help\", icon: glyph(\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3M12 17h.01\") },\n];\n\ntype Project = { id: string; name: string; meta: string; color: string; status: \"Live\" | \"Building\" | \"Draft\" };\n\nconst projects: Project[] = [\n  { id: \"storefront\", name: \"Storefront\", meta: \"Updated 2h ago\", color: \"bg-orange-500\", status: \"Live\" },\n  { id: \"docs\", name: \"Docs\", meta: \"Updated yesterday\", color: \"bg-sky-500\", status: \"Live\" },\n  { id: \"dashboard\", name: \"Admin dashboard\", meta: \"Updated 3 days ago\", color: \"bg-violet-500\", status: \"Building\" },\n  { id: \"blog\", name: \"Blog\", meta: \"Updated last week\", color: \"bg-emerald-500\", status: \"Live\" },\n];\n\nconst status = {\n  Live: \"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400\",\n  Building: \"bg-amber-500/10 text-amber-700 dark:text-amber-400\",\n  Draft: \"bg-zinc-500/10 text-zinc-600 dark:text-zinc-400\",\n};\n\nconst panel = \"rounded-lg bg-white ring-1 ring-zinc-900/[0.06] dark:bg-zinc-950 dark:ring-white/[0.06]\";\n\nexport function SpotlightTourDemo() {\n  const [open, setOpen] = React.useState(false);\n  const [list, setList] = React.useState(projects);\n\n  const addProject = () =>\n    setList((current) =>\n      current.length >= 6\n        ? current\n        : [{ id: `draft-${current.length}`, name: \"Untitled project\", meta: \"Just now\", color: \"bg-zinc-400\", status: \"Draft\" }, ...current],\n    );\n\n  return (\n    <div className=\"flex h-[28rem] w-full max-w-3xl gap-2 overflow-hidden rounded-xl border border-zinc-200 bg-zinc-100 p-2 dark:border-zinc-800 dark:bg-zinc-900\">\n      <aside data-tour=\"sidebar\" className={`${panel} flex w-12 shrink-0 flex-col gap-0.5 p-1.5 sm:w-44 sm:p-2`}>\n        <span className=\"mb-3 flex h-8 items-center gap-2 px-1.5 text-sm font-semibold text-zinc-900 dark:text-zinc-50\">\n          <span aria-hidden className=\"size-5 shrink-0 rounded-md bg-gradient-to-br from-orange-400 to-rose-500\" />\n          <span className=\"hidden sm:inline\">Acme</span>\n        </span>\n        {nav.map((item, i) => (\n          <span\n            key={item.label}\n            className={\n              i === 0\n                ? \"flex h-8 items-center gap-2.5 rounded-md bg-zinc-100 px-2 text-sm text-zinc-900 dark:bg-zinc-900 dark:text-zinc-50\"\n                : \"flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-zinc-500\"\n            }\n          >\n            {item.icon}\n            <span className=\"hidden sm:inline\">{item.label}</span>\n          </span>\n        ))}\n        <div className=\"mt-auto hidden rounded-md bg-zinc-50 p-2.5 sm:block dark:bg-zinc-900\">\n          <p className=\"text-xs font-medium text-zinc-900 dark:text-zinc-100\">Hobby plan</p>\n          <div className=\"mt-2 h-1 rounded-full bg-zinc-200 dark:bg-zinc-800\">\n            <div className=\"h-full w-2/3 rounded-full bg-zinc-900 dark:bg-zinc-100\" />\n          </div>\n          <p className=\"mt-1.5 text-[11px] text-zinc-500\">4 of 6 projects</p>\n        </div>\n      </aside>\n\n      <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n        <header className=\"flex h-10 shrink-0 items-center justify-between gap-3 pl-2\">\n          <p className=\"truncate text-sm text-zinc-500\">\n            Acme <span className=\"px-1 text-zinc-300 dark:text-zinc-700\">/</span>\n            <span className=\"text-zinc-900 dark:text-zinc-50\">Projects</span>\n          </p>\n          <div className=\"flex items-center gap-2\">\n            <div data-tour=\"toolbar\" className=\"flex items-center rounded-full bg-white p-1 ring-1 ring-zinc-900/[0.06] dark:bg-zinc-950 dark:ring-white/[0.06]\">\n              {tools.map((tool) => (\n                <button\n                  key={tool.label}\n                  type=\"button\"\n                  aria-label={tool.label}\n                  className=\"grid size-7 place-items-center rounded-full text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-900 dark:hover:bg-zinc-900 dark:hover:text-zinc-50\"\n                >\n                  {tool.icon}\n                </button>\n              ))}\n            </div>\n            <button\n              data-tour=\"avatar\"\n              type=\"button\"\n              aria-label=\"Account\"\n              className=\"grid size-9 place-items-center rounded-full bg-gradient-to-br from-sky-400 to-indigo-500 text-xs font-semibold text-white ring-2 ring-white dark:ring-zinc-950\"\n            >\n              JL\n            </button>\n          </div>\n        </header>\n\n        <main className={`${panel} flex min-h-0 flex-1 flex-col overflow-hidden`}>\n          <div className=\"flex items-center justify-between gap-3 border-b border-zinc-100 px-4 py-3 dark:border-zinc-900\">\n            <h3 className=\"text-sm font-medium text-zinc-900 dark:text-zinc-50\">Projects</h3>\n            <button\n              data-tour=\"new\"\n              type=\"button\"\n              onClick={addProject}\n              className=\"inline-flex h-8 items-center gap-1.5 rounded-lg bg-zinc-900 px-3 text-sm font-medium text-white transition-[background-color,scale] duration-150 hover:bg-zinc-800 active:scale-[0.97] dark:bg-zinc-50 dark:text-zinc-900 dark:hover:bg-zinc-200\"\n            >\n              <svg aria-hidden viewBox=\"0 0 24 24\" className=\"size-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.25} strokeLinecap=\"round\">\n                <path d=\"M12 5v14M5 12h14\" />\n              </svg>\n              New\n            </button>\n          </div>\n\n          <ul className=\"min-h-0 flex-1 overflow-hidden px-2 py-1.5\">\n            <AnimatePresence initial={false}>\n              {list.map((project) => (\n                <motion.li\n                  key={project.id}\n                  layout\n                  initial={{ opacity: 0, y: -6 }}\n                  animate={{ opacity: 1, y: 0 }}\n                  transition={{ type: \"spring\", visualDuration: 0.35, bounce: 0.15 }}\n                  className=\"flex h-12 items-center gap-3 rounded-md px-2\"\n                >\n                  <span aria-hidden className={`size-2 shrink-0 rounded-full ${project.color}`} />\n                  <span className=\"min-w-0 flex-1\">\n                    <span className=\"block truncate text-sm text-zinc-900 dark:text-zinc-100\">{project.name}</span>\n                    <span className=\"block truncate text-xs text-zinc-500\">{project.meta}</span>\n                  </span>\n                  <span className={`rounded-full px-2 py-0.5 text-[11px] font-medium ${status[project.status]}`}>\n                    {project.status}\n                  </span>\n                </motion.li>\n              ))}\n            </AnimatePresence>\n          </ul>\n\n          <div className=\"flex items-center justify-between gap-3 border-t border-zinc-100 bg-zinc-50/60 px-4 py-3 dark:border-zinc-900 dark:bg-zinc-900/40\">\n            <p className=\"text-sm text-pretty text-zinc-600 dark:text-zinc-400\">New here? Take a 20-second tour.</p>\n            <button\n              type=\"button\"\n              onClick={() => setOpen(true)}\n              className=\"h-8 shrink-0 rounded-lg px-3 text-sm font-medium text-zinc-900 ring-1 ring-zinc-900/10 transition-[background-color,scale] duration-150 hover:bg-white active:scale-[0.97] dark:text-zinc-50 dark:ring-white/10 dark:hover:bg-zinc-900\"\n            >\n              Start tour\n            </button>\n          </div>\n        </main>\n      </div>\n\n      <SpotlightTour open={open} onOpenChange={setOpen} steps={steps} />\n    </div>\n  );\n}\n"
    }
  ]
}