Default OTP Input

PreviousNext

A default one-time password input component

Docs
shadcnui-blockscomponent

Preview

Loading preview…
components/customized/input-otp/input-otp-01.tsx
import {
  InputOTP,
  InputOTPGroup,
  InputOTPSeparator,
  InputOTPSlot,
} from "@/registry/ui/input-otp";

export default 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>
  );
}

Installation

npx shadcn@latest add @shadcnui-blocks/input-otp-01

Usage

import { InputOtp01 } from "@/components/input-otp-01"
<InputOtp01 />