@akhatmirzo/ui

OTP verification

Verify a 6-digit SMS code: OtpInput, a useCountdown resend timer and limited attempts.

Add with the CLI: npx @akhatmirzo/cli add otp-verify

Telefonni tasdiqlang

+998 90 *** ** 67 raqamiga 6 xonali kod yubordik.

Sinov kodi: 246810

Kod kelmadimi?
Raqamni o'zgartirish

What's inside

  • The code is checked automatically once complete (onComplete); the test code is 246810.
  • A wrong code marks the field invalid and shows the remaining attempts.
  • The resend button stays disabled until useCountdown(59) finishes.
  • A success state after verification.

Components used

Installation

The CLI copies the block file into your project (components/blocks/otp-verify.tsx) and offers to install the packages it needs:

npx @akhatmirzo/cli add otp-verify

Manually: install the packages and copy the file from the "Code" tab into your project.

pnpm add @akhatmirzo/ui @akhatmirzo/tokens @akhatmirzo/hooks lucide-react