BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/delta-components/input-otp-form-demo

input-otp-form-demo

delta-components/input-otp-form-demo
FreeExample

delta-components publishes no description for this item.

Install it

npx shadcn@latest add https://deltacomponents.dev/r/input-otp-form-demo.json

Source

examples/input-otp-form-demo.tsxdeltacomponents.dev/r/input-otp-form-demo.json
1"use client"
2
3import * as React from "react"
4import { zodResolver } from "@hookform/resolvers/zod"
5import { useForm } from "react-hook-form"
6import { toast } from "sonner"
7import { z } from "zod"
8
9import {
10 InputOTP,
11 InputOTPGroup,
12 InputOTPSlot,
13} from "@/components/ui/input-otp"
14import { Button } from "@/components/ui/button"
15import {
16 Card,
17 CardContent,
18 CardDescription,
19 CardFooter,
20 CardHeader,
21 CardTitle,
22} from "@/components/ui/card"
23import { Checkbox } from "@/components/ui/checkbox"
24import {
25 Form,
26 FormControl,
27 FormField,
28 FormItem,
29 FormLabel,
30 FormMessage,
31} from "@/components/ui/form"
32
33const FormSchema = z.object({
34 pin: z
35 .string()
36 .min(6, {
37 message: "Your one-time password must be 6 characters.",
38 })
39 .regex(/^\d+$/, {
40 message: "Your one-time password must contain numbers only.",
41 }),
42})
43
44export default function InputOTPForm() {
45 const [autoSubmit, setAutoSubmit] = React.useState(true)
46
47 const form = useForm<z.infer<typeof FormSchema>>({
48 resolver: zodResolver(FormSchema),
49 defaultValues: {
50 pin: "",
51 },
52 })
53
54 // Watch the pin value for auto-submit
55 const pinValue = form.watch("pin")
56
57 React.useEffect(() => {
58 if (autoSubmit && pinValue.length === 6) {
59 form.handleSubmit(onSubmit)()
60 }
61 }, [pinValue, autoSubmit])
62
63 function onSubmit(data: z.infer<typeof FormSchema>) {
64 toast("You submitted the following values:", {
65 description: (
66 <pre className="bg-code text-code-foreground mt-2 w-[320px] overflow-x-auto rounded-md p-4">
67 <code>{JSON.stringify(data, null, 2)}</code>
68 </pre>
69 ),
70 position: "bottom-right",
71 classNames: {
72 content: "flex flex-col gap-2",
73 },
74 style: {
75 "--border-radius": "calc(var(--radius) + 4px)",
76 } as React.CSSProperties,
77 })
78 form.reset()
79 }
80
81 return (
82 <div className="w-full space-y-4 sm:max-w-md">
83 <Card>
84 <CardHeader>
85 <CardTitle>Two-Factor Authentication</CardTitle>
86 <CardDescription>
87 Please enter the 6-digit code sent to your device.
88 </CardDescription>
89 </CardHeader>
90 <CardContent>
91 <Form {...form}>
92 <form
93 id="otp-form"
94 onSubmit={form.handleSubmit(onSubmit)}
95 className="space-y-6"
96 >
97 <FormField
98 control={form.control}
99 name="pin"
100 render={({ field }) => (
101// … truncated

What it pulls in

Other registry items

  • form
  • card
  • @delta/input-otp

Files it writes

  • registry/delta-ui/examples/input-otp-form-demo.tsx

Facts

Registry
delta-components
Type
registry:example
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

Docs on delta-components deltacomponents.dev pprunty/deltacomponents.dev on GitHub Raw registry item This item as JSON

More from delta-components

All 93 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
admonition-actions-demoadmonition-actions-demodelta-componentsExamplesFreeno deps
admonition-collapsible-demoadmonition-collapsible-demodelta-componentsExamplesFreeno deps
admonition-custom-icon-demoadmonition-custom-icon-demodelta-componentsExamplesFreeno deps
admonition-demoadmonition-demodelta-componentsExamplesFreeno deps
admonition-demo-interactiveadmonition-demo-interactivedelta-componentsExamplesFreeno deps
admonition-dismissible-demoadmonition-dismissible-demodelta-componentsExamplesFreeno deps
cambio-image-close-button-democambio-image-close-button-demodelta-componentsExamplesFreeno deps
cambio-image-democambio-image-demodelta-componentsExamplesFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex