IMask

imaskjs

vanilla javascript input mask

npm version License: MIT Coverage Status

Features

  • get and set raw and unmasked values easily
  • no external dependencies
  • supports overwrite mode
  • supports web components
  • supports contenteditable
  • RegExp mask
  • Function mask
  • Number mask (integer and decimal)
  • Date mask (various format support, autofix mode)
  • Dynamic/on-the-fly mask
  • Pattern mask
    • show placeholder always and only when necessary
    • unmasked value can contain fixed parts
    • optional input parts (greedy)
    • custom definitions
    • reusable blocks
    • secure text entry
    • Enum and Range masks
    • Repeating blocks
  • convert and format values with pipe

Plugins

Install

npm install @bsolute/imask and import IMask from '@bsolute/imask';

or use CDN:

<script src="https://unpkg.com/@bsolute/imask"></script>

Build & Test

npm run make

Publish

  1. npm login
  2. npm run make
  3. npm run release
    This runs docs, tests, build, then lerna publish.

Compatibility

Supports all major browsers. Can also be used with outdated browsers. See how

Getting help