Two Factor 1 - Six-digit code entry

A centered verification card asking for the six-digit code from an authenticator app, with auto-submit on the last digit, inline error state and a link to use a backup code instead. Use it as the second step of sign-in for accounts with 2FA enabled.

About Two Factor 1

A centered verification card asking for the six-digit code from an authenticator app, with auto-submit on the last digit, inline error state and a link to use a backup code instead. Use it as the second step of sign-in for accounts with 2FA enabled.

Two Factor 1 is a free two factor block for React, built on shadcn/ui and Tailwind CSS. It ships as 101 lines of TypeScript you own: every piece of copy is a prop with a sensible default, so you can drop it in and replace the content without touching the layout.

  • two-factor
  • 2fa
  • otp
  • verification
  • authenticator
  • auth

Installation

  1. Add the Chocolate UI registry to your components.json (see the installation guide).
  2. Run the shadcn CLI:
npx shadcn@latest add @chocolate/two-factor-01

Dependencies installed automatically: lucide-react.

Uses: button, input-otp, reveal, utils.

Usage

import TwoFactor01 from "@/components/blocks/two-factor-01"

export default function Page() {
  return <TwoFactor01 />
}

FAQ