suiss/ui · Component
Keypad
A numeric keypad with round digit keys, a delete key and an optional decimal or biometric key.
Keypad 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.

Keypad lays out digits 1 to 9 in three rows and a bottom row with an accessory key, 0 and a delete key. Each key is a KeypadKey, a round Pressable with the button role. Digit keys have a filled background; the accessory and delete keys use the plain variant with no fill.
Use it for PIN entry, amounts and other numeric input where the system keyboard is not wanted.
Installation
The CLI also adds what it builds on: Icon, Text.
Manual
-
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
Handle input in onKeyPress, which receives a digit string ("0" to "9"), "decimal", "delete" or "biometric". The keypad holds no value of its own.
Set accessoryKey to decimal or biometric to fill the bottom-left slot; otherwise it stays empty. Change the decimal character with decimalSeparator and the biometric icon with biometricIcon.
Use deleteDisabled to turn off only the delete key, for example when the value is empty. KeypadKey is exported for custom layouts, along with the KeypadDigit, KeypadKeyValue and KeypadAccessoryKey types.
Examples
Decimal
A keypad with a decimal separator key.

Biometric
A keypad with a biometric key.

Disabled
A fully disabled keypad.

API Reference
KeypadKey
A single round key that passes text and icon styles to its children.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "plain" | "default" | default with a filled background, or plain without one. |
className | string | - | |
children | React.ReactNode | - |
Also accepts the props of React.ComponentProps<typeof Pressable>.
Keypad
The full grid of keys.
| Prop | Type | Default | Description |
|---|---|---|---|
onKeyPress | (key: KeypadKeyValue) => void | - | Called with the pressed key value. |
accessoryKey | KeypadAccessoryKey | - | Bottom-left key: decimal or biometric. |
decimalSeparator | string | "." | Character shown on the decimal key. Defaults to .. |
biometricIcon | PhosphorIcon | FingerprintIcon | Phosphor icon for the biometric key. Defaults to FingerprintIcon. |
biometricLabel | string | "Use biometrics" | Accessibility label for the biometric key. |
decimalLabel | string | "Decimal separator" | Accessibility label for the decimal key. |
deleteLabel | string | "Delete" | Accessibility label for the delete key. |
disabled | boolean | false | Disables every key. |
deleteDisabled | boolean | false | Disables only the delete key. |
keyClassName | string | - | Extra classes applied to each key. |
Also accepts the props of React.ComponentProps<typeof View>.
Accessibility
- Every key has the
buttonrole and anaccessibilityLabel: the digit itself, ordecimalLabel,biometricLabelanddeleteLabelfor the other keys. - Disabled keys set
disabledin their accessibility state and block presses. - Translate the default labels (
Decimal separator,Use biometrics,Delete) for localized apps.
Notes
- Filled keys use
bg-secondary,opacity-80when pressed andopacity-50when disabled. - Digits use
text-2xlwith tabular numbers. - Light and dark colors follow the system appearance.



