suiss/uim · Block

Verify Device

A sign-in approval flow where a trusted device shows an alert, then a code to enter on the new device.

Verify Device is an open-source mobile screen from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Verify Device on iOS in light mode

The screen shows a mock alert from the trusted device with Allow and Don't Allow. Allowing reveals a code and an InputOTP to enter it, with a Spinner while checking and an error for a wrong code; denying shows a blocked message with an option to show the request again. A correct code shows an approved screen.

Installation

$ pnpm dlx @esuiss/uim@latest add verify-device

The CLI also adds what it builds on: Icon, Input Otp, Keyboard Scroll View, Screen, Spinner, Text.

Manual

  1. Install the dependencies:
npx expo install cn phosphor-react-native react-native-reanimated react-native-svg react-native-worklets
  1. Add the pieces it builds on: Icon, Input Otp, Keyboard Scroll View, Screen, Spinner, Text.

  2. Copy the source into components/blocks/verify-device.tsx:

uniwind/components/blocks/verify-device.tsx
import { cn } from "cn"
import {
  CheckIcon,
  DeviceMobileIcon,
  LockSimpleIcon,
} from "phosphor-react-native"
import * as React from "react"
import { Pressable, View } from "react-native"
import { FadeIn, FadeInDown, ReduceMotion } from "react-native-reanimated"
import { AnimatedView } from "@/components/ui/animated-view"
import { Icon } from "@/components/ui/icon"
import {
  InputOTP,
  InputOTPGroup,
  InputOTPSlot,
} from "@/components/ui/input-otp"
  1. Update the import paths to match your project.

Usage

import { VerifyDevice } from "@/components/blocks/verify-device"
<VerifyDevice />

onVerify receives the code and returns a boolean or a promise; by default it accepts the demo code 482913. Edit COPY to change the text for each phase.