Skip to content
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-model is the PIN as a string of digits. length (default 4) sets the number of digits. When the last digit is entered, finish sends 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.
  • invalid makes 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 labels or a label pack. labels.pin names the pad (default "PIN").

Usage ​

ts
import { BlessPinPad } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
lengthnumber4digits in the PIN
namestring—submitted with the form as the PIN
disabledboolean—
invalidboolean—the PIN was wrong: the dots turn red until the next key
labelsPartial<{ pin: string; entered: (n: number, length: number) => string; delete: string; clear: string; }>—
modelValuestring""

Events

NamePayloadDescription
update:modelValue[value: string]
finish[pin: string]

Released under the MIT License. Character names and artwork belong to their owners.