{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "textarea-form", "type": "registry:example", "author": "shadcn (https://ui.shadcn.com)", "registryDependencies": [ "textarea", "form" ], "files": [ { "path": "examples/textarea-form.tsx", "content": "\"use client\"\n\nimport { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { toast } from \"@/registry/new-york/hooks/use-toast\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"@/registry/new-york/ui/form\"\nimport { Textarea } from \"@/registry/new-york/ui/textarea\"\n\nconst FormSchema = z.object({\n bio: z\n .string()\n .min(10, {\n message: \"Bio must be at least 10 characters.\",\n })\n .max(160, {\n message: \"Bio must not be longer than 30 characters.\",\n }),\n})\n\nexport default function TextareaForm() {\n const form = useForm>({\n resolver: zodResolver(FormSchema),\n })\n\n function onSubmit(data: z.infer) {\n toast({\n title: \"You submitted the following values:\",\n description: (\n
\n          {JSON.stringify(data, null, 2)}\n        
\n ),\n })\n }\n\n return (\n
\n \n (\n \n Bio\n \n \n \n \n You can @mention other users and organizations.\n \n \n \n )}\n />\n \n \n \n )\n}\n", "type": "registry:example", "target": "" } ] }