UX

Number input fields are more complex than they seem.

  • Do not use type="number"
    • type="number" is intended for integers and includes features we don’t want (like stepper/scroll functionality) that is a nuisance to everyone.
    • Phone, credit card, pin etc. are not integers
    • Older versions of NVDA don’t support type="number"

Annotations for number inputs

  • type=text inputmode="numeric"
    • Ensures maximum support and opens the numeric keypad on mobile devices
The pin number will expire after 1 hour

Annotations for telephone input

  • type="tel"
    • Ensures maximum support and opens the numeric keypad on mobile devices
We’ll never sell or share your information

Further reading

Related number input entries