{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-react-hook-form-demo",
  "title": "UseReactHookFormDemo",
  "description": "use-react-hook-form's hook in action.",
  "registryDependencies": [
    "card",
    "label",
    "input",
    "button",
    "https://guarahooks.com/r/use-react-hook-form.json"
  ],
  "files": [
    {
      "path": "registry/example/use-react-hook-form-demo.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { toast } from 'sonner';\n\nimport { Button } from '@/components/ui/button';\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from '@/components/ui/card';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\n\nimport { useReactHookForm } from '@/hooks/guarahooks/use-react-hook-form';\n\nexport default function UseReactHookFormDemo() {\n  const {\n    register,\n    onSubmit,\n    formState: { errors },\n  } = useReactHookForm<{ firstName: string; lastName: string }>({\n    defaultValues: { firstName: '', lastName: '' },\n  });\n\n  const handleFormSubmit = (data: { firstName: string; lastName: string }) => {\n    console.log('Form Data:', data);\n    toast.success(`Hello, ${data.firstName} ${data.lastName}!`);\n  };\n\n  return (\n    <Card className=\"max-w-md w-full\">\n      <CardHeader>\n        <CardTitle>useReactHookForm</CardTitle>\n        <CardDescription>Simplified React Hook Form usage</CardDescription>\n      </CardHeader>\n      <CardContent className=\"space-y-4\">\n        <div className=\"grid gap-2\">\n          <Label htmlFor=\"firstName\">First Name</Label>\n          <Input\n            id=\"firstName\"\n            {...register('firstName', { required: 'First name is required' })}\n          />\n          {errors.firstName && (\n            <p className=\"text-destructive\">{errors.firstName.message}</p>\n          )}\n        </div>\n        <div className=\"grid gap-2\">\n          <Label htmlFor=\"lastName\">Last Name</Label>\n          <Input\n            id=\"lastName\"\n            {...register('lastName', { required: 'Last name is required' })}\n          />\n          {errors.lastName && (\n            <p className=\"text-destructive\">{errors.lastName.message}</p>\n          )}\n        </div>\n      </CardContent>\n      <CardFooter>\n        <Button onClick={onSubmit(handleFormSubmit)} className=\"w-full\">\n          Submit\n        </Button>\n      </CardFooter>\n    </Card>\n  );\n}\n",
      "type": "registry:example",
      "target": "components/example/use-react-hook-form-demo.tsx"
    }
  ],
  "type": "registry:example"
}