shadcn

Input OTP

Forms 17

About

Accessible one-time password component with copy paste functionality.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Input OTP to your project and fits it to your theme.

Code

How Input OTP is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  InputOTP,
  InputOTPGroup,
  InputOTPSeparator,
  InputOTPSlot,
} from "@/components/ui/input-otp"

export function InputOTPDemo() {
  return (
    <InputOTP maxLength={6}>
      <InputOTPGroup>
        <InputOTPSlot index={0} />
        <InputOTPSlot index={1} />
        <InputOTPSlot index={2} />
      </InputOTPGroup>
      <InputOTPSeparator />
      <InputOTPGroup>
        <InputOTPSlot index={3} />
        <InputOTPSlot index={4} />
        <InputOTPSlot index={5} />
      </InputOTPGroup>
    </InputOTP>
  )
}

Dependencies

More by shadcn

View all
  • Navigation menu

    Navigation menu

    805
  • Calendar with time pressets

    Calendar with time pressets

    527
  • Sidebar

    Sidebar

    359
  • Sonner

    Sonner

    250
  • Chart

    Chart

    229
  • Icons

    Icons

    209
  • Dropdown Menu

    Dropdown Menu

    160
  • Calendar with event slots

    Calendar with event slots

    125

More in Forms

View all
  • Login 1

    Login 1

    63
  • Premium Auth

    Premium Auth

    570
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Book A Demo 1

    Book A Demo 1

    91
  • Authentication Card

    Authentication Card

    52
  • Card Studio

    Card Studio

    47
  • Login Card

    Login Card

    35