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

    806
  • Calendar with time pressets

    Calendar with time pressets

    528
  • Sidebar

    Sidebar

    359
  • Sonner

    Sonner

    250
  • Chart

    Chart

    230
  • Icons

    Icons

    209
  • Dropdown Menu

    Dropdown Menu

    160
  • Calendar with event slots

    Calendar with event slots

    125

More in Forms

View all
  • Premium Auth

    Premium Auth

    572
  • Login 1

    Login 1

    64
  • Contact Card

    Contact Card

    1.1K
  • Horizontal Form Fields

    Horizontal Form Fields

    8
  • Form

    Form

  • Contact Form

    Contact Form

    26
  • Book A Demo 1

    Book A Demo 1

    91
  • Authentication Card

    Authentication Card

    52