InputOTPSlot() — ui Function Reference
Architecture documentation for the InputOTPSlot() function in input-otp.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD e1bb8b14_aa8c_8e29_4f25_65757ff59129["InputOTPSlot()"] 1b7612bc_0a58_2c15_aab2_7ba351cf9c59["input-otp.tsx"] e1bb8b14_aa8c_8e29_4f25_65757ff59129 -->|defined in| 1b7612bc_0a58_2c15_aab2_7ba351cf9c59 style e1bb8b14_aa8c_8e29_4f25_65757ff59129 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/examples/radix/ui-rtl/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-e text-sm transition-all outline-none first:rounded-s-lg first:border-s last:rounded-e-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/radix/ui-rtl/input-otp.tsx.
Where is InputOTPSlot() defined?
InputOTPSlot() is defined in apps/v4/examples/radix/ui-rtl/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