{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcn-studio/button-28","type":"registry:component","title":"Button 28","description":"Copy button with state transition animation between copy and check icons","dependencies":["lucide-react"],"registryDependencies":["button","utils"],"files":[{"path":"src/registry/new-york/components/button/button-28.tsx","content":"'use client'\n\nimport { useState } from 'react'\n\nimport { CheckIcon, CopyIcon } from 'lucide-react'\n\nimport { Button } from '@/registry/new-york/ui/button'\n\nimport { cn } from '@/registry/new-york/lib/utils'\n\nconst ButtonCopyStateDemo = () => {\n  const [copied, setCopied] = useState<boolean>(false)\n\n  const handleCopy = async () => {\n    try {\n      await navigator.clipboard.writeText('Thank you for using Shadcn Studio!')\n      setCopied(true)\n      setTimeout(() => setCopied(false), 1500)\n    } catch (err) {\n      console.error('Failed to copy text: ', err)\n    }\n  }\n\n  return (\n    <Button variant='outline' className='relative disabled:opacity-100' onClick={handleCopy} disabled={copied}>\n      <span className={cn('transition-all', copied ? 'scale-100 opacity-100' : 'scale-0 opacity-0')}>\n        <CheckIcon className='stroke-green-600 dark:stroke-green-400' />\n      </span>\n      <span className={cn('absolute left-4 transition-all', copied ? 'scale-0 opacity-0' : 'scale-100 opacity-100')}>\n        <CopyIcon />\n      </span>\n      {copied ? 'Copied!' : 'Copy'}\n    </Button>\n  )\n}\n\nexport default ButtonCopyStateDemo\n","type":"registry:component","target":"components/shadcn-studio/button/button-28.tsx"}]}