2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-20 20:00:34 +03:00

docs: update for single package

This commit is contained in:
Alexander Shabunevich
2024-06-02 15:43:46 +03:00
parent 9b454e996a
commit 0ef436ca3d
11 changed files with 245 additions and 217 deletions
+6 -25
View File
@@ -1,24 +1,5 @@
# Usage with Svelte
## Installation
You can install Maska with following command:
```sh
npm install @maskajs/svelte@3
```
And then use it in your `.svelte` component:
```svelte
import { maska } from '@maskajs/svelte'
<input use:maska data-maska="#-#" />
```
## Action signature
Maska provides simple Svelte action for use with input:
```html
@@ -34,7 +15,7 @@ Apply `maska` action to the input along with `data-maska` attribite:
```svelte
<script>
import { maska } from '@maskajs/svelte'
import { maska } from '@maskajs/svelte'
</script>
<input use:maska data-maska="#-#">
@@ -47,12 +28,12 @@ To set default [options](/options) for the mask, pass options via **directive va
```svelte
<script>
import { maska } from '@maskajs/svelte'
import { maska } from '@maskajs/svelte'
const options = {
mask: "#-#",
eager: true
}
const options = {
mask: "#-#",
eager: true
}
</script>
<input use:maska={options} data-maska-reversed>