# Authenticator App

> Authenticator App for Two-Factor Setup.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/two-factor-setup-1).

- Page, with a live preview: https://shadcn.exchange/r/flx/two-factor-setup-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/two-factor-setup-1-light-19162a2c974b4bdb.png
- Registry item: https://ui.flexnative.com/r/two-factor-setup-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/two-factor-setup-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `input-otp`, `lucide-react`
- Registry items: `button`, `card`, `input-otp`

## Files

### `registry/intents/auth/two-factor-setup/two-factor-setup-1.tsx`

```tsx
'use client'

import { useState } from 'react'
import { ShieldCheckIcon } from 'lucide-react'

import { Button } from '@/components/ui/button'
import {
  Card,
  CardContent,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@/components/ui/card'
import {
  InputOTP,
  InputOTPGroup,
  InputOTPSlot,
} from '@/components/ui/input-otp'

export function TwoFactorSetup1() {
  const [code, setCode] = useState('')

  return (
    <Card size="sm">
      <CardHeader>
        <div className="bg-primary/10 mb-1 flex size-10 items-center justify-center rounded-full">
          <ShieldCheckIcon className="text-primary size-5" />
        </div>
        <CardTitle>Set up authenticator</CardTitle>
        <p className="text-muted-foreground text-xs">
          Scan the QR code with your authenticator app, then enter the 6-digit
          code it shows.
        </p>
      </CardHeader>

      <CardContent className="flex flex-col gap-4">
        <div className="flex justify-center">
          <div className="border-border grid size-28 grid-cols-7 grid-rows-7 gap-px rounded-md border p-2">
            {Array.from({ length: 49 }).map((_, i) => (
              <span
                key={i}
                className={
                  (i * 7 + 3) % 5 < 2 || i % 3 === 0
                    ? 'bg-foreground rounded-[1px]'
                    : 'bg-transparent'
                }
              />
            ))}
          </div>
        </div>

        <div className="flex justify-center">
          <InputOTP maxLength={6} value={code} onChange={setCode}>
            <InputOTPGroup>
              <InputOTPSlot index={0} />
              <InputOTPSlot index={1} />
              <InputOTPSlot index={2} />
              <InputOTPSlot index={3} />
              <InputOTPSlot index={4} />
              <InputOTPSlot index={5} />
            </InputOTPGroup>
          </InputOTP>
        </div>
      </CardContent>

      <CardFooter>
        <Button className="w-full" disabled={code.length < 6}>
          Verify & enable
        </Button>
      </CardFooter>
    </Card>
  )
}
```
