0.3.5 • Published 2 years ago

svelte-mask v0.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

svelte-input-mask

The simplest component of an input mask with validation for digits of a given format, which can contain arbitrary non-numeric characters

image

Features:

  • The minified bundle weighs less than 5kb
  • universal validation for any numeric formats

Installation:

npm i svelte-mask

Demo

Using inside Svelte app:

<script>
  import PhoneMaskInput from 'svelte-mask'
</script>

<PhoneMaskInput originHolder="+1(000)0000000" />

Using inside vanile app:

using modules:

import PhoneMaskInput from 'svelte-mask'

const app = new PhoneMaskInput({
  target: document.getElementById('app'),
  props: {
    originHolder: '+1(000)0000000'
  }  
})

export default app

using prepared bundle:

  <link rel="stylesheet" href="https://unpkg.com/svelte-mask@latest/build/css/app.css">  

  <div id="app"></div>    
  <script src="https://unpkg.com/svelte-mask@latest/build/bundle.js"></script>
  <script>
      createMaskInput('app', '+7(999)9999999')        
  </script>

PS:

if you found this component useful, you can show it by clicking on the star

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago