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
-
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
Decimal
A keypad with a decimal separator key in the bottom-left slot.
Set accessoryKey to decimal to show it.

Biometric
A keypad with a biometric key in the bottom-left slot.
Set accessoryKey to biometric to show it.

Disabled
A fully disabled keypad.
Set disabled to turn off every key.

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.
API Reference
KeypadKey
A single round key that passes text and icon styles to its children.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "plain" | "default" |
className | string | - |
children | React.ReactNode | - |
Also accepts the props of React.ComponentProps<typeof Pressable>.
The default variant has a filled bg-secondary background and the plain variant has none. Keys drop to opacity-80 when pressed and opacity-50 when disabled. Digits use text-2xl with tabular numbers. KeypadKey is exported for custom layouts.
Keypad
The full grid of keys.
| Prop | Type | Default |
|---|---|---|
onKeyPress | (key: KeypadKeyValue) => void | - |
accessoryKey | KeypadAccessoryKey | - |
decimalSeparator | string | "." |
biometricIcon | PhosphorIcon | FingerprintIcon |
biometricLabel | string | "Use biometrics" |
decimalLabel | string | "Decimal separator" |
deleteLabel | string | "Delete" |
disabled | boolean | false |
deleteDisabled | boolean | false |
keyClassName | string | - |
Also accepts the props of React.ComponentProps<typeof View>.
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 Phosphor icon with biometricIcon. biometricLabel, decimalLabel and deleteLabel are the accessibility labels of those keys.
Use deleteDisabled to turn off only the delete key, for example when the value is empty. keyClassName adds classes to each key. The KeypadDigit, KeypadKeyValue and KeypadAccessoryKey types are also exported.
KeypadKey
| Value | Parameters |
|---|---|
.digit | Int |
.decimal | - |
.delete | - |
.biometric | - |
KeypadAccessory
| Value | Parameters |
|---|---|
.none | - |
.decimal | String, label: LocalizedStringKey = "Decimal separator" |
.biometric | Image, label: LocalizedStringKey = "Use biometrics" |
Keypad
The full grid of keys.
| Parameter | Type | Default |
|---|---|---|
accessory | KeypadAccessory | .none |
deleteLabel | LocalizedStringKey | "Delete" |
deleteDisabled | Bool | false |
onKeyPress | (KeypadKey) -> Void | - |
KeypadKey
| Value | Parameters |
|---|---|
Digit | value: Int |
Decimal | - |
Biometric | - |
Delete | - |
KeypadAccessory
| Value | Parameters |
|---|---|
None | - |
Decimal | separator: String = ".", label: String = "Decimal separator" |
Biometric | icon: ImageVector = PhosphorIcons.Regular.Fingerprint, label: String = "Use biometrics" |
Keypad
The full grid of keys.
| Parameter | Type | Default |
|---|---|---|
onKeyPress | (KeypadKey) -> Unit | - |
modifier | Modifier | Modifier |
accessory | KeypadAccessory | KeypadAccessory.None |
deleteLabel | String | "Delete" |
enabled | Boolean | true |



