InputOTPForm() — ui Function Reference
Architecture documentation for the InputOTPForm() function in input-otp-form.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 08733225_b803_6cef_3416_a4e05f6cb673["InputOTPForm()"] 6aee089f_c54f_660e_245e_048abbfa35f6["input-otp-form.tsx"] 08733225_b803_6cef_3416_a4e05f6cb673 -->|defined in| 6aee089f_c54f_660e_245e_048abbfa35f6 style 08733225_b803_6cef_3416_a4e05f6cb673 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/registry/default/examples/input-otp-form.tsx lines 30–82
export default function InputOTPForm() {
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
pin: "",
},
})
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="pin"
render={({ field }) => (
<FormItem>
<FormLabel>One-Time Password</FormLabel>
<FormControl>
<InputOTP maxLength={6} {...field}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</FormControl>
<FormDescription>
Please enter the one-time password sent to your phone.
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<Button type="submit">Submit</Button>
</form>
</Form>
)
}
Domain
Subdomains
Source
Frequently Asked Questions
What does InputOTPForm() do?
InputOTPForm() is a function in the ui codebase, defined in deprecated/www/registry/default/examples/input-otp-form.tsx.
Where is InputOTPForm() defined?
InputOTPForm() is defined in deprecated/www/registry/default/examples/input-otp-form.tsx at line 30.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free