Calm motion: animations on this site only fade, with no movement
PinPad
On-screen keypad for a PIN
A keypad with large keys, for a PIN on a kiosk, a point of sale, a tablet, or a lock screen. On a page with a keyboard, a one-time code in InputOTP is easier to use.
Basic
0 of 4 digits entered
Enter 1984.
v-modelis the PIN as a string of digits.length(default 4) sets the number of digits. When the last digit is entered,finishsends the PIN, and more keys do nothing.- The dots show how many digits are entered, never the digits. A screen reader hears "2 of 4 digits entered" after each key.
- Clear removes all digits and ⌫ removes the last one. A hardware keyboard works too, when the focus is in the pad: digits type, Backspace removes the last one, and Delete clears.
invalidmakes the dots red. Set it when the PIN is wrong, and clear the PIN, as the demo does. Say why in text as well, because color alone does not tell everyone.- With
name, a hidden input sends the PIN with its form. - The keys are always in the same order. Change the words with
labelsor a label pack.labels.pinnames the pad (default "PIN").
Usage
ts
import { BlessPinPad } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
length | number | 4 | digits in the PIN |
name | string | — | submitted with the form as the PIN |
disabled | boolean | — | |
invalid | boolean | — | the PIN was wrong: the dots turn red until the next key |
labels | Partial<{ pin: string; entered: (n: number, length: number) => string; delete: string; clear: string; }> | — | |
modelValue | string | "" |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: string] | |
finish | [pin: string] |