DEV Community

loading...

What are your go-to libraries for input masking?

geoff profile image Geoff Davis ・1 min read

My definition of input masking:

Formatting of user-input in an <input> element as it is provided, into a preset shape/structure

For example, here is a set of phone inputs that have masks setup:

Image of HTML input elements that have preset 'masks' to auto-format user input

This CSS-Tricks link showcases some examples as well as some libraries, but I'm interested in what the DEV community uses nowadays (that post is ~2 years old).

Bonus points if the library is framework agnostic, i.e. does not use jQuery, Angular, React, Vue, etc.

Discussion

pic
Editor guide