{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "select-form", "type": "registry:example", "author": "shadcn (https://ui.shadcn.com)", "registryDependencies": [ "select" ], "files": [ { "path": "examples/select-form.tsx", "content": "\"use client\"\n\nimport Link from \"next/link\"\nimport { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { toast } from \"@/registry/default/hooks/use-toast\"\nimport { Button } from \"@/registry/default/ui/button\"\nimport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"@/registry/default/ui/form\"\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/registry/default/ui/select\"\n\nconst FormSchema = z.object({\n email: z\n .string({\n required_error: \"Please select an email to display.\",\n })\n .email(),\n})\n\nexport default function SelectForm() {\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 Email\n \n \n You can manage email addresses in your{\" \"}\n email settings.\n \n \n \n )}\n />\n \n \n \n )\n}\n", "type": "registry:example", "target": "" } ] }