suiss/ui ยท Block
Login Passkey
A passwordless sign-in screen that runs a simulated face scan in a dialog, then welcomes the user.
Login Passkey 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 passwordless sign-in screen with an account chip, a Continue with passkey button and a fallback link to sign in with a password. Starting the flow opens a small dialog with a scanning animation that turns into a check mark, then the screen welcomes the user. Use it as the front door for passkey or biometric login.
The scan is faked with timers in start; replace it with a WebAuthn call such as navigator.credentials.get and move to the welcome state when it resolves. Replace the account email, initials and welcome name, and point the #change and #password links at your routes.
Closing the dialog cancels the pending timers; abort your WebAuthn request the same way when the user cancels.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Web preview
A sign-in screen that shows the account with an Avatar, a Change link, a Continue with passkey Button and a link to sign in with a password. Continuing opens a Dialog with an animated scan glyph that turns into a verified state, then shows a welcome view with a Sign out link. The dialog can be cancelled during the scan.
Installation
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Dialog, Icon, Screen, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/login-passkey.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Dialog, Icon, Screen, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/login-passkey.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Avatar, Button, Dialog, Icon, Screen, Text.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy and paste the following code into
components/blocks/login-passkey.tsx:
- Update the import paths to match your project setup.
-
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.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 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
Call your passkey API from onContinue, and wire onChangeAccount and onUsePassword to your navigation. The account details and the scan timing are sample values in the component.