Patterns · Pages
Verify code
VerifyCodePageVerifyCodeScreen
One-time code for sign-in or a second factor: boxes that take the OS code suggestion and submit when full, a resend countdown, the code lifetime and other ways to verify.
Web
Live, at a real viewport width. Switch to Phone to see the responsive layout.
Usage
import { VerifyCodePage } from '@nexub/patterns';
<VerifyCodePage
destination="+65 •••• 4821"
onComplete={(code) => verify(code)}
onResend={resend}
expiresAt={expiresAt}
onChangeDestination={changeNumber}
methods={[{ id: 'app', label: 'Use an authenticator app' }, { id: 'recovery', label: 'Use a recovery code' }]}
onMethodChange={setMethod}
loading={checking}
error={error}
/>On iOS & Android: VerifyCodeScreen
@nexub/react-native/patternsAlpha
import { VerifyCodeScreen } from '@nexub/react-native/patterns';
<VerifyCodeScreen destination="+65 •••• 4821" onComplete={verify} onResend={resend} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Autofill | autocomplete="one-time-code" on the first box. | SMS code autofill from the keyboard. |
| Resend | A countdown line that becomes a "Resend code" link. | A full-width Resend button, disabled while it counts down. |
| Other methods | methods, expiresAt and onChangeDestination. | Code entry and resend only. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
VerifyCodeScreen props
| Prop | Type | Default | Description |
|---|---|---|---|
| destinationrequired | string | — | Where the code went, e.g. "+65 •••• 4821". |
| onCompleterequired | (code: string) => void | — | — |
| onResendrequired | () => void | — | — |
| resendAfter | number | 30 | Seconds before Resend is allowed again. |
| length | number | 6 | — |
| error | string | — | — |