{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-keypress-demo",
  "title": "UseKeypressDemo",
  "description": "use-keypress's hook in action.",
  "registryDependencies": [
    "card",
    "https://guarahooks.com/r/use-keypress.json"
  ],
  "files": [
    {
      "path": "registry/example/use-keypress-demo.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport confetti from 'canvas-confetti';\n\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from '@/components/ui/card';\n\nimport { useKeypress } from '@/hooks/guarahooks/use-keypress';\n\nexport default function UseKeypressDemo() {\n  const popStars = () => {\n    const defaults = {\n      spread: 360,\n      ticks: 50,\n      gravity: 0,\n      decay: 0.94,\n      startVelocity: 30,\n      colors: ['#FFE400', '#FFBD00', '#E89400', '#FFCA6C', '#FDFFB8'],\n    };\n\n    const shoot = () => {\n      confetti({\n        ...defaults,\n        particleCount: 40,\n        scalar: 1.2,\n        shapes: ['star'],\n      });\n\n      confetti({\n        ...defaults,\n        particleCount: 10,\n        scalar: 0.75,\n        shapes: ['circle'],\n      });\n    };\n\n    setTimeout(shoot, 0);\n    setTimeout(shoot, 100);\n    setTimeout(shoot, 200);\n  };\n\n  useKeypress({\n    combo: ['ctrl+m', 'meta+m'],\n    callback: (e) => {\n      popStars();\n    },\n    preventDefault: true,\n  });\n\n  return (\n    <Card className=\"relative max-w-sm w-full\">\n      <CardHeader>\n        <CardTitle>useKeypress</CardTitle>\n        <CardDescription>\n          This component uses the <code>useKeypress</code> hook to detect key\n          combinations.\n        </CardDescription>\n      </CardHeader>\n      <CardContent className=\"space-y-2\">\n        <p>Press Ctrl+M (Windows/Linux) or Cmd+M (Mac) to see some magic.</p>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:example",
      "target": "components/example/use-keypress-demo.tsx"
    }
  ],
  "type": "registry:example"
}