GitHub

OTPVerifyForm

An OTP verification form for email verification flows with resend functionality.

Loading...

Installation

pnpm add @corew500/ui

Usage

import { OTPVerifyForm } from '@corew500/ui/blocks/otp-verify-form'

<OTPVerifyForm
  onFormSubmit={(data) => handleOTP(data)}
  onResend={() => handleResendOTP()}
  email="user@example.com"
  title="Verify Your Email"
  description="We sent a verification code to your email address."
/>

API Reference

Props

PropTypeDefaultDescription
onFormSubmit(data: OTPVerifyFormData) => voidCalled when the form is submitted
onResend() => voidCalled when resend is clicked
loadingenumfalseWhether the form is in a loading state
successenumfalseWhen true, shows success state instead of form
glowenumfalseEnable glow effects
lengthnumber6OTP code length
emailstringEmail address for display
titlestringEnter verification code
descriptionstring
successTitlestringVerified!
successDescriptionstringYour code has been verified successfully.
successActionenum
buttonLabels{ submit?: string; loading?: string; resend?: string; resendCooldown?: string; }{}
errors{ code?: string; general?: string; }{}
features{ autoSubmit?: boolean; }{}
resendCooldownnumber60Resend cooldown in seconds