input-otp.tsx — ui Source File
Architecture documentation for input-otp.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f082ebf2_19a1_8ef2_7c06_d04e373fd816["input-otp.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] f082ebf2_19a1_8ef2_7c06_d04e373fd816 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 46c758ca_dd64_66c4_37b9_b30acc3c853c["input-otp"] f082ebf2_19a1_8ef2_7c06_d04e373fd816 --> 46c758ca_dd64_66c4_37b9_b30acc3c853c 8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"] f082ebf2_19a1_8ef2_7c06_d04e373fd816 --> 8ad666ec_1b20_adda_0392_87a60bdb3a68 de6fac54_74ca_6c25_8f8b_d1ba3287dbf2["icon-placeholder"] f082ebf2_19a1_8ef2_7c06_d04e373fd816 --> de6fac54_74ca_6c25_8f8b_d1ba3287dbf2 style f082ebf2_19a1_8ef2_7c06_d04e373fd816 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { OTPInput, OTPInputContext } from "input-otp"
import { cn } from "@/registry/bases/base/lib/utils"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
function InputOTP({
className,
containerClassName,
...props
}: React.ComponentProps<typeof OTPInput> & {
containerClassName?: string
}) {
return (
<OTPInput
data-slot="input-otp"
containerClassName={cn(
"cn-input-otp flex items-center has-disabled:opacity-50",
containerClassName
)}
spellCheck={false}
className={cn(
"cn-input-otp-input disabled:cursor-not-allowed",
className
)}
{...props}
/>
)
}
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="input-otp-group"
className={cn("cn-input-otp-group flex items-center", className)}
{...props}
/>
)
}
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(
"cn-input-otp-slot relative flex items-center justify-center data-[active=true]:z-10",
className
)}
{...props}
>
{char}
{hasFakeCaret && (
<div className="cn-input-otp-caret pointer-events-none absolute inset-0 flex items-center justify-center">
<div className="cn-input-otp-caret-line" />
</div>
)}
</div>
)
}
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="input-otp-separator"
className="cn-input-otp-separator flex items-center"
role="separator"
{...props}
>
<IconPlaceholder
lucide="MinusIcon"
tabler="IconMinus"
hugeicons="MinusSignIcon"
phosphor="MinusIcon"
remixicon="RiSubtractLine"
/>
</div>
)
}
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
Domain
Subdomains
Dependencies
- icon-placeholder
- input-otp
- react
- utils
Source
Frequently Asked Questions
What does input-otp.tsx do?
input-otp.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in input-otp.tsx?
input-otp.tsx defines 4 function(s): InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot.
What does input-otp.tsx depend on?
input-otp.tsx imports 4 module(s): icon-placeholder, input-otp, react, utils.
Where is input-otp.tsx in the architecture?
input-otp.tsx is located at apps/v4/registry/bases/base/ui/input-otp.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free