suiss/ui · Block
Verify Code
A two-factor authentication screen with a six-digit code entry, error feedback, and a resend countdown.
Verify Code is an open-source block from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
A two-factor screen with a six-digit code field that turns red on a wrong code and green on success, plus a resend countdown and a help link. A wrong code shakes the field and clears it. Use it for 2FA, phone verification or any one-time code step.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Add the pieces it builds on: Input OTP.
-
Copy the source into
components/blocks/verify-code.tsx:
- Update the import paths to match your project.
Usage
Replace the comparison with DEMO_CODE in complete with your verification API, and remove the demo code hint. Resend only restarts the 30-second timer, so connect it to your code delivery service. Point #help at your support page.
Notes
The code field receives focus on load, and errors are announced.

An InputOTP with six slots checks the code when the last digit is entered; a wrong code shakes the input and shows an error, and a correct one shows a verified screen. A resend link counts down from 30 seconds, and a help link sits below.
Installation
The CLI also adds what it builds on: Icon, Input OTP, Keyboard Scroll View, Screen, Text. On React Native it also adds the animated view components/ui/animated-view.tsx.
Manual
- Install the dependencies:
-
Add the pieces it builds on: Icon, Input OTP, Keyboard Scroll View, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/verify-code.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Icon, Input OTP, Keyboard Scroll View, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/verify-code.tsx:
- Update the import paths to match your project.
- Install the dependencies:
-
Add the pieces it builds on: Icon, Input OTP, Keyboard Scroll View, Screen, Text, and the animated view
components/ui/animated-view.tsxfrom the next step. -
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the source into
components/blocks/verify-code.tsx:
- Update the import paths to match your project.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
onVerify receives the code and returns a boolean or a promise; by default it accepts the demo code 482913. onHelp handles the help link.
