suiss/ui · Component
Pin Pad
A passcode entry screen element with a row of dots and a numeric keypad.
Pin Pad is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

PinPad combines a row of dots that fill as digits are entered with a Keypad for input. The length is between 4 and 8 digits. Each key press plays a selection haptic, and switching to the error state turns the dots red, plays an error haptic and shakes the row with Reanimated. Haptics play when a haptics adapter is provided through HapticsContext.
An optional biometric key appears in the bottom-left corner of the keypad when onBiometric is set, and the delete key is disabled while nothing is entered.
Installation
The CLI also adds what it builds on: Keypad. It also adds the animated view components/ui/animated-view.tsx.
- Install the following dependencies:
-
Add the pieces it builds on: Keypad.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/pin-pad.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Keypad.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/pin-pad.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Keypad.
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/pin-pad.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
Examples
Filled
A pin pad with four of six digits entered.

Error
The error state with red dots.

Verify
Checks the code on completion, shows an error for a wrong code and clears it.
onComplete fires with the full code once the last digit is entered. Check the code there, set error when it is wrong and clear the value to let the user try again.

This code uses Tailwind classes that need Uniwind or NativeWind. With StyleSheet, pass the same values through the style props.
Disabled
A disabled pin pad with a biometric key.

Biometric
A biometric key with the default fingerprint icon.

Face biometric
A biometric key with a face icon and a matching label.
Set biometricIcon and biometricLabel to match the method in use.

Four digits
A four-digit code with length={4}.

Accessibility
- The dots row is a single element labeled by
dotsLabel, so screen readers hear progress without the digits. - The row is a polite live region, so TalkBack announces progress as it changes.
- Keypad keys are buttons labeled with their digit; the delete and biometric keys use
deleteLabelandbiometricLabel. - The shake animation respects the system reduce motion setting.
API Reference
PinPad
The PinPad component shows passcode dots above a numeric keypad.
| Prop | Type | Default |
|---|---|---|
length | number | 6 |
value | string | - |
defaultValue | string | "" |
onValueChange | (value: string) => void | - |
onComplete | (value: string) => void | - |
error | boolean | false |
disabled | boolean | false |
onBiometric | () => void | - |
biometricIcon | PhosphorIcon | - |
biometricLabel | string | - |
deleteLabel | string | - |
dotsLabel | (entered: number, length: number) => string | defaultDotsLabel |
dotsClassName | string | - |
keypadClassName | string | - |
Also accepts the props of React.ComponentProps<typeof View>.
Use it uncontrolled with defaultValue, or controlled with value and onValueChange. Non-digits in defaultValue are removed. length is clamped between 4 and 8. onValueChange is called after each digit or deletion, and onComplete with the full code when the last digit is entered. Turning error on shakes the dots and plays an error haptic. disabled turns off the keypad and dims the dots.
The biometric key is shown only when onBiometric is set. biometricLabel and deleteLabel are the accessibility labels of those keys. dotsLabel builds the dots label from the entered count and the length, such as "3 of 6 entered". Style the dots and keypad separately with dotsClassName and keypadClassName.
PinPad
The PinPad component shows passcode dots above a numeric keypad.
| Parameter | Type | Default |
|---|---|---|
value | Binding<String> | - |
length | Int | 6 |
error | Bool | false |
biometricIcon | Image | Ph.fingerprint.regular |
biometricLabel | LocalizedStringKey | "Use biometrics" |
deleteLabel | LocalizedStringKey | "Delete" |
onBiometric | (() -> Void)? | nil |
onComplete | ((String) -> Void)? | nil |
PinPad
The PinPad component shows passcode dots above a numeric keypad.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
value | String? | null |
onValueChange | ((String) -> Unit)? | null |
defaultValue | String | "" |
length | Int | 6 |
onComplete | ((String) -> Unit)? | null |
error | Boolean | false |
enabled | Boolean | true |
onBiometric | (() -> Unit)? | null |
biometricIcon | ImageVector | PhosphorIcons.Regular.Fingerprint |
biometricLabel | String | "Use biometrics" |
deleteLabel | String | "Delete" |
entryLabel | (entered: Int, length: Int) -> String | { entered, total -> "$entered of $total entered" } |







