boardui

Input OTP

Component

About

A one-time-code input with a monospace box per digit that supports typing, backspace navigation, arrow-key movement, paste distribution and OS autofill.

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

"use client";

import { InputOtp } from "@/components/ui/input-otp";

export default function InputOtpVariantsDemo() {
  return (
    <div className="flex flex-col items-center gap-6">
      <InputOtp length={4} aria-label="PIN" />
      <InputOtp groupEvery={3} aria-label="Verification code" />
      <InputOtp isInvalid aria-label="Verification code" />
      <InputOtp isDisabled defaultValue="1234" aria-label="Verification code" />
    </div>
  );
}

More by boardui

View all
  • Social Button

    Social Button

    4
  • Modal Dialog

    Modal Dialog

    3
  • Select

    Select

    1
  • Accordion

    Accordion

    1
  • Segmented Control

    Segmented Control

  • Date Calendar

    Date Calendar

  • Composer Loader

    Composer Loader

  • Slider

    Slider

Explore more