ProfileForm() — ui Function Reference
Architecture documentation for the ProfileForm() function in profile-form.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 69c6e1ef_2a26_9dcb_2382_52a427796c97["ProfileForm()"] 8d6f1cba_9692_d9ae_146c_bfcba6c637c7["profile-form.tsx"] 69c6e1ef_2a26_9dcb_2382_52a427796c97 -->|defined in| 8d6f1cba_9692_d9ae_146c_bfcba6c637c7 style 69c6e1ef_2a26_9dcb_2382_52a427796c97 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/app/(app)/examples/forms/profile-form.tsx lines 65–191
export function ProfileForm() {
const form = useForm<ProfileFormValues>({
resolver: zodResolver(profileFormSchema),
defaultValues,
mode: "onChange",
})
const { fields, append } = useFieldArray({
name: "urls",
control: form.control,
})
function onSubmit(data: ProfileFormValues) {
toast({
title: "You submitted the following values:",
description: (
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
</pre>
),
})
}
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
<FormField
control={form.control}
name="username"
render={({ field }) => (
<FormItem>
<FormLabel>Username</FormLabel>
<FormControl>
<Input placeholder="shadcn" {...field} />
</FormControl>
<FormDescription>
This is your public display name. It can be your real name or a
pseudonym. You can only change this once every 30 days.
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="email"
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a verified email to display" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="m@example.com">m@example.com</SelectItem>
<SelectItem value="m@google.com">m@google.com</SelectItem>
<SelectItem value="m@support.com">m@support.com</SelectItem>
</SelectContent>
</Select>
<FormDescription>
You can manage verified email addresses in your{" "}
<Link href="/examples/forms">email settings</Link>.
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="bio"
render={({ field }) => (
<FormItem>
<FormLabel>Bio</FormLabel>
<FormControl>
<Textarea
placeholder="Tell us a little bit about yourself"
className="resize-none"
{...field}
/>
Domain
Subdomains
Source
Frequently Asked Questions
What does ProfileForm() do?
ProfileForm() is a function in the ui codebase, defined in deprecated/www/app/(app)/examples/forms/profile-form.tsx.
Where is ProfileForm() defined?
ProfileForm() is defined in deprecated/www/app/(app)/examples/forms/profile-form.tsx at line 65.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free