{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "domain-switch-demo",
  "type": "registry:block",
  "title": "Domain Switch: Dark Mode",
  "description": "Dark Mode Toggle example, Dark Mode: A landing page's theme toggle. Dark mode opens from the button as a domain and takes the page over, with a seam of stars at its edge; press again to draw it back in. A take on the toggle (switch). Fits navbar and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "navbar",
    "app-ui",
    "toggle",
    "theme",
    "transition",
    "canvas"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/domain-switch#domain-switch-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/domain-switch.json"
  ],
  "files": [
    {
      "path": "components/domain-switch-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { DomainSwitch, DomainSwitchScope, DomainSwitchToggle } from \"@/components/ui/domain-switch\";\n\nexport function DomainSwitchDemo() {\n  const [dark, setDark] = React.useState(false);\n\n  return (\n    <div className=\"w-full overflow-hidden rounded-xl border border-zinc-200 dark:border-zinc-800\">\n      <DomainSwitch checked={dark} onCheckedChange={setDark}>\n        <DomainSwitchScope\n          className=\"h-[var(--demo-height,560px)]\"\n          outside={<Landing dark={false} />}\n          inside={<Landing dark />}\n        />\n      </DomainSwitch>\n    </div>\n  );\n}\n\nfunction Landing({ dark }: { dark: boolean }) {\n  return (\n    <div\n      className={cn(\n        \"relative flex h-full flex-col overflow-hidden\",\n        dark ? \"bg-[#09090c] text-zinc-100\" : \"bg-[#fbfbfa] text-zinc-900\",\n      )}\n    >\n      {dark && (\n        <div\n          aria-hidden\n          className=\"pointer-events-none absolute inset-x-0 top-0 h-72 bg-[radial-gradient(60%_100%_at_50%_0%,rgba(129,140,248,0.16),transparent)]\"\n        />\n      )}\n      <nav className=\"relative flex items-center gap-6 px-5 py-4 sm:px-8\">\n        <span className=\"flex items-center gap-2 text-sm font-semibold tracking-tight\">\n          <span\n            className={cn(\n              \"grid size-6 place-items-center rounded-md text-[11px] font-bold\",\n              dark ? \"bg-indigo-400 text-[#09090c]\" : \"bg-zinc-900 text-white\",\n            )}\n          >\n            T\n          </span>\n          Tidal\n        </span>\n        <div className={cn(\"hidden gap-5 text-sm sm:flex\", dark ? \"text-zinc-400\" : \"text-zinc-500\")}>\n          <span>Product</span>\n          <span>Pricing</span>\n          <span>Docs</span>\n        </div>\n        <div className=\"ml-auto flex items-center gap-2\">\n          <DomainSwitchToggle\n            aria-label=\"Dark mode\"\n            className={cn(\n              \"size-9 rounded-full border\",\n              dark\n                ? \"border-white/10 bg-white/5 text-indigo-200 hover:bg-white/10\"\n                : \"border-zinc-200 bg-white text-zinc-700 shadow-xs hover:bg-zinc-50\",\n            )}\n          >\n            {dark ? <MoonIcon /> : <SunIcon />}\n          </DomainSwitchToggle>\n          <a\n            href=\"#\"\n            className={cn(\n              \"hidden rounded-full px-4 py-2 text-sm font-medium sm:block\",\n              dark ? \"bg-zinc-100 text-zinc-900\" : \"bg-zinc-900 text-white\",\n            )}\n          >\n            Sign in\n          </a>\n        </div>\n      </nav>\n\n      <section className=\"relative mx-auto flex max-w-2xl flex-col items-center px-5 pt-8 text-center sm:pt-12\">\n        <span\n          className={cn(\n            \"rounded-full border px-3 py-1 text-xs\",\n            dark ? \"border-indigo-400/25 bg-indigo-400/10 text-indigo-200\" : \"border-zinc-200 bg-white text-zinc-600\",\n          )}\n        >\n          New: answers in Slack\n        </span>\n        <h1 className=\"mt-5 text-3xl font-semibold tracking-tight text-balance sm:text-5xl/[1.05]\">\n          Analytics that answer back.\n        </h1>\n        <p className={cn(\"mt-4 max-w-md text-sm text-pretty sm:text-base\", dark ? \"text-zinc-400\" : \"text-zinc-600\")}>\n          Ask a question in plain words. Tidal writes the query, checks it and draws the chart.\n        </p>\n        <div className=\"mt-6 flex gap-2\">\n          <a\n            href=\"#\"\n            className={cn(\n              \"rounded-full px-5 py-2.5 text-sm font-medium\",\n              dark ? \"bg-indigo-400 text-[#09090c]\" : \"bg-zinc-900 text-white\",\n            )}\n          >\n            Start free\n          </a>\n          <a\n            href=\"#\"\n            className={cn(\n              \"rounded-full border px-5 py-2.5 text-sm font-medium\",\n              dark ? \"border-white/10 text-zinc-200\" : \"border-zinc-200 bg-white text-zinc-800\",\n            )}\n          >\n            Book a demo\n          </a>\n        </div>\n      </section>\n\n      <section className=\"relative mx-auto mt-10 grid w-full max-w-3xl grid-cols-1 gap-3 px-5 sm:grid-cols-2 sm:px-8\">\n        <Card dark={dark} title=\"Live queries\" body=\"Weekly signups, by channel\">\n          <svg viewBox=\"0 0 200 48\" className=\"h-12 w-full\" aria-hidden>\n            <path\n              d=\"M0 40 L20 36 L40 38 L60 28 L80 30 L100 20 L120 24 L140 14 L160 16 L180 8 L200 10\"\n              fill=\"none\"\n              strokeWidth=\"2\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              className={dark ? \"stroke-indigo-300\" : \"stroke-zinc-900\"}\n            />\n          </svg>\n        </Card>\n        <Card dark={dark} title=\"Shared boards\" body=\"Three people are looking at Q3\">\n          <div className=\"flex h-12 items-center -space-x-2\">\n            {[\"bg-amber-300\", \"bg-sky-300\", \"bg-rose-300\"].map((color) => (\n              <span\n                key={color}\n                className={cn(\"size-8 rounded-full border-2\", color, dark ? \"border-[#121217]\" : \"border-white\")}\n              />\n            ))}\n          </div>\n        </Card>\n      </section>\n    </div>\n  );\n}\n\nfunction Card({\n  dark,\n  title,\n  body,\n  children,\n}: {\n  dark: boolean;\n  title: string;\n  body: string;\n  children: React.ReactNode;\n}) {\n  return (\n    <div\n      className={cn(\n        \"rounded-2xl border p-4\",\n        dark ? \"border-white/[0.07] bg-[#121217]\" : \"border-zinc-200 bg-white shadow-xs\",\n      )}\n    >\n      {children}\n      <p className=\"mt-3 text-sm font-medium\">{title}</p>\n      <p className={cn(\"text-xs\", dark ? \"text-zinc-500\" : \"text-zinc-500\")}>{body}</p>\n    </div>\n  );\n}\n\nfunction SunIcon() {\n  return (\n    <svg viewBox=\"0 0 24 24\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\">\n      <circle cx=\"12\" cy=\"12\" r=\"4\" />\n      <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n    </svg>\n  );\n}\n\nfunction MoonIcon() {\n  return (\n    <svg viewBox=\"0 0 24 24\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <path d=\"M20.5 14.1A8.5 8.5 0 1 1 9.9 3.5a7 7 0 0 0 10.6 10.6Z\" />\n    </svg>\n  );\n}\n"
    }
  ]
}