@opentf/vue-input-mask
TypeScript icon, indicating that this package has built-in type declarations

0.9.1 • Public • Published

Vue Input Mask

by OPEN TECH FOUNDATION

Build

The input mask directive for Vue.js.

Demo

Features

  • Simple API

  • Lightweight ~1.5 KB Gzipped

  • RegExp Support

  • Custom tokens

  • Get raw/unmasked values via callback fn

Installation

Using npm

npm install @opentf/vue-input-mask

Using Yarn

yarn add @opentf/vue-input-mask

Using pnpm

pnpm add @opentf/vue-input-mask

Usage

<script setup>
import { vMask } from "@opentf/vue-input-mask";
</script>

<template>
  <input v-mask="{ mask: '#####' }" />
</template>
Default Tokens:

#  - Number only, [0-9]
$  - Char only, [A-Z, a-z]
*  - Number or Char, [a-z, A-Z, 0-9]
A  - Uppercase char [A-Z], transform: (c) => c.toLocaleUpperCase()
a  - Lowercase char [a-z], transform: (c) => c.toLocaleLowerCase()
\\ - Escape token, eg: \\$
{} - Regular expression, eg: {[A-F]}

Documentation

Please visit https://vue-input-mask.pages.dev to get started.

License

Copyright (c) Thanga Ganapathy (MIT License).

/@opentf/vue-input-mask/

    Package Sidebar

    Install

    npm i @opentf/vue-input-mask

    Weekly Downloads

    5

    Version

    0.9.1

    License

    MIT

    Unpacked Size

    12.1 kB

    Total Files

    13

    Last publish

    Collaborators

    • ganapathy