Home / Function/ InputOTPControlled() — ui Function Reference

InputOTPControlled() — ui Function Reference

Architecture documentation for the InputOTPControlled() function in input-otp-controlled.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  ef2bee11_714d_4718_3635_18acd7bbbba6["InputOTPControlled()"]
  a038d787_be7d_7228_e7f7_fd47f99f1b5e["input-otp-controlled.tsx"]
  ef2bee11_714d_4718_3635_18acd7bbbba6 -->|defined in| a038d787_be7d_7228_e7f7_fd47f99f1b5e
  style ef2bee11_714d_4718_3635_18acd7bbbba6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/input-otp-controlled.tsx lines 10–38

export default function InputOTPControlled() {
  const [value, setValue] = React.useState("")

  return (
    <div className="space-y-2">
      <InputOTP
        maxLength={6}
        value={value}
        onChange={(value) => setValue(value)}
      >
        <InputOTPGroup>
          <InputOTPSlot index={0} />
          <InputOTPSlot index={1} />
          <InputOTPSlot index={2} />
          <InputOTPSlot index={3} />
          <InputOTPSlot index={4} />
          <InputOTPSlot index={5} />
        </InputOTPGroup>
      </InputOTP>
      <div className="text-center text-sm">
        {value === "" ? (
          <>Enter your one-time password.</>
        ) : (
          <>You entered: {value}</>
        )}
      </div>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does InputOTPControlled() do?
InputOTPControlled() is a function in the ui codebase, defined in apps/v4/examples/base/input-otp-controlled.tsx.
Where is InputOTPControlled() defined?
InputOTPControlled() is defined in apps/v4/examples/base/input-otp-controlled.tsx at line 10.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free