Home / Function/ InputForm() — ui Function Reference

InputForm() — ui Function Reference

Architecture documentation for the InputForm() function in input-form.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  b7158a83_e869_667a_7c78_a2bfb44d536c["InputForm()"]
  afdb690d_e17f_7606_be98_ebd513a5f439["input-form.tsx"]
  b7158a83_e869_667a_7c78_a2bfb44d536c -->|defined in| afdb690d_e17f_7606_be98_ebd513a5f439
  style b7158a83_e869_667a_7c78_a2bfb44d536c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/registry/default/examples/input-form.tsx lines 26–68

export default function InputForm() {
  const form = useForm<z.infer<typeof FormSchema>>({
    resolver: zodResolver(FormSchema),
    defaultValues: {
      username: "",
    },
  })

  function onSubmit(data: z.infer<typeof FormSchema>) {
    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="w-2/3 space-y-6">
        <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.
              </FormDescription>
              <FormMessage />
            </FormItem>
          )}
        />
        <Button type="submit">Submit</Button>
      </form>
    </Form>
  )
}

Subdomains

Frequently Asked Questions

What does InputForm() do?
InputForm() is a function in the ui codebase, defined in deprecated/www/registry/default/examples/input-form.tsx.
Where is InputForm() defined?
InputForm() is defined in deprecated/www/registry/default/examples/input-form.tsx at line 26.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free