InputOTPSlot() — ui Function Reference
Architecture documentation for the InputOTPSlot() function in input-otp.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD e7618aae_0435_dddc_2141_125e6e9ee075["InputOTPSlot()"] 4b88a797_e33b_88ee_9256_20a0d58a4c52["input-otp.tsx"] e7618aae_0435_dddc_2141_125e6e9ee075 -->|defined in| 4b88a797_e33b_88ee_9256_20a0d58a4c52 style e7618aae_0435_dddc_2141_125e6e9ee075 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/examples/base/ui/input-otp.tsx lines 42–70
function InputOTPSlot({
index,
className,
...props
}: React.ComponentProps<"div"> & {
index: number
}) {
const inputOTPContext = React.useContext(OTPInputContext)
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
return (
<div
data-slot="input-otp-slot"
data-active={isActive}
className={cn(
"dark:bg-input/30 border-input data-[active=true]:border-ring data-[active=true]:ring-ring/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-8 items-center justify-center border-y border-r text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg data-[active=true]:z-10 data-[active=true]:ring-3",
className
)}
{...props}
>
{char}
{hasFakeCaret && (
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
</div>
)}
</div>
)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does InputOTPSlot() do?
InputOTPSlot() is a function in the ui codebase, defined in apps/v4/examples/base/ui/input-otp.tsx.
Where is InputOTPSlot() defined?
InputOTPSlot() is defined in apps/v4/examples/base/ui/input-otp.tsx at line 42.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free