honestui

OTP Field

Component

About

Enter a one-time code, with one box per character, paste, and autofill from messages.

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

Code

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

Usage.tsx

"use client"

import "honestui/theme.css"
import { OTPField } from "@/components/ui/honest-otp-field"

const sizes = [
  { size: "sm", label: "Small" },
  { size: "default", label: "Default" },
  { size: "lg", label: "Large" },
] as const

export default function OTPFieldSizes() {
  return (
    <div data-theme="light" className="flex flex-wrap items-end justify-center gap-8">
      {sizes.map(({ size, label }) => (
        <div key={size} className="flex w-fit flex-col gap-2">
          <label className="text-sm font-medium">{label}</label>
          <OTPField length={4} size={size} defaultValue="4821" />
        </div>
      ))}
    </div>
  )
}

Dependencies

More by honestui

View all
  • Chromatic Text Reveal

    Chromatic Text Reveal

    31
  • Schedule Builder

    Schedule Builder

  • Audit Log

    Audit Log

  • Secret Row

    Secret Row

  • Undoable Action

    Undoable Action

  • Audio Orb

    Audio Orb

  • AI Glow Border

    AI Glow Border

  • Metaballs

    Metaballs