BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/uiable/input-otp

Input Otp

uiable/input-otp
FreeComponent

Input Otp component.

Live preview

live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://uiable.com/r/input-otp.json

Source

src/components/ui/input-otp.tsxuiable.com/r/input-otp.json
1"use client";
2
3import { ComponentProps, useContext } from "react";
4
5import { OTPInput, OTPInputContext } from "input-otp";
6
7import { cn } from "@/lib/utils";
8import { MinusIcon } from "lucide-react";
9
10function InputOTP({
11 className,
12 containerClassName,
13 ...props
14}: ComponentProps<typeof OTPInput> & {
15 containerClassName?: string;
16}) {
17 return (
18 <OTPInput
19 data-slot="input-otp"
20 containerClassName={cn(
21 "cn-input-otp flex items-center has-disabled:opacity-50",
22 containerClassName
23 )}
24 spellCheck={false}
25 className={cn("disabled:cursor-not-allowed", className)}
26 {...props}
27 />
28 );
29}
30
31function InputOTPGroup({ className, ...props }: ComponentProps<"div">) {
32 return (
33 <div
34 data-slot="input-otp-group"
35 className={cn(
36 "has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive flex items-center rounded-lg has-aria-invalid:ring-0",
37 className
38 )}
39 {...props}
40 />
41 );
42}
43
44function InputOTPSlot({
45 index,
46 className,
47 ...props
48}: ComponentProps<"div"> & {
49 index: number;
50}) {
51 const inputOTPContext = useContext(OTPInputContext);
52 const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
53
54 return (
55 <div
56 data-slot="input-otp-slot"
57 data-active={isActive}
58 className={cn(
59 "dark:bg-input/30 border-border data-[active=true]:border-border data-[active=true]:ring-input/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex size-10 items-center justify-center border-y border-r text-base transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg data-[active=true]:z-10 data-[active=true]:ring-0",
60 className
61 )}
62 {...props}
63 >
64 {char}
65 {hasFakeCaret && (
66 <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
67 <div className="animate-caret-blink bg-foreground w-px duration-1000" />
68 </div>
69 )}
70 </div>
71 );
72}
73
74function InputOTPSeparator({ ...props }: ComponentProps<"div">) {
75 return (
76 <div
77 data-slot="input-otp-separator"
78 className="flex items-center [&_svg:not([class*='size-'])]:size-4 px-1"
79// … truncated

What it pulls in

npm packages

  • input-otp
  • lucide-react

Files it writes

  • src/components/ui/input-otp.tsx

Facts

Registry
uiable
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on uiable uiable.com codedthemes/uiable on GitHub Raw registry item This item as JSON

More from uiable

All 712 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionuiableComponentsFree2 deps
AlertalertuiableComponentsFree1 dep
Alert Dialogalert-dialoguiableComponentsFree1 dep
Aspect Ratioaspect-ratiouiableComponentsFreeno deps
AttachmentattachmentuiableComponentsFree2 deps
AvataravataruiableComponentsFree1 dep
BadgebadgeuiableComponentsFree2 deps
BreadcrumbbreadcrumbuiableComponentsFree2 deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex