Skip to content

Commit 228d4c9

Browse files
committed
docs(input): add mask example
1 parent 150b334 commit 228d4c9

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup lang="ts">
2+
import { vMaska } from 'maska/vue'
3+
</script>
4+
5+
<template>
6+
<div class="flex flex-col gap-2">
7+
<UInput v-maska="'#### #### #### ####'" placeholder="4242 4242 4242 4242" icon="i-lucide-credit-card" />
8+
9+
<div class="flex items-center gap-2">
10+
<UInput v-maska="'##/##'" placeholder="MM/YY" icon="i-lucide-calendar" />
11+
<UInput v-maska="'###'" placeholder="CVC" />
12+
</div>
13+
</div>
14+
</template>

docs/content/3.components/input.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ name: 'input-kbd-example'
278278
This example uses the `defineShortcuts` composable to focus the Input when the :kbd{value="/"} key is pressed.
279279
::
280280

281+
### With mask
282+
283+
There's no built-in support for masks, but you can use librairies like [maska](https://github.com/beholdr/maska) to mask the Input.
284+
285+
::component-example
286+
---
287+
name: 'input-mask-example'
288+
---
289+
::
290+
281291
### With floating label
282292

283293
You can use the `#default` slot to add a floating label to the Input.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"ai": "^4.3.16",
2222
"capture-website": "^4.2.0",
2323
"joi": "^17.13.3",
24+
"maska": "^3.1.1",
2425
"motion-v": "^1.1.1",
2526
"nuxt": "^3.17.5",
2627
"nuxt-component-meta": "^0.11.0",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)