Skip to content

FormInputMask ​

A FormKit wrapper for OpenVue's InputMask component.

Live Example on Website

Usage ​

vue
<FormKit type="formInputMask" v-model="value" mask="99-999999" />

Object-based Example ​

vue
<script setup>
const schema = [
  {
    $formkit: 'formInputMask',
    name: 'myInputMask',
    label: 'Input Mask',
    validation: 'required',
    validationVisibility: 'live',
    mask: '99-999999',
    placeholder: '##-######'
  },
  {
    $formkit: 'formInputMask',
    name: 'custom',
    label: 'Input Mask',
    mask: '(999) 999-9999',
    iconPrefix: 'oi oi-check',
    iconSuffix: 'oi oi-check'
  },
  {
    $formkit: 'formInputMask',
    name: 'phone',
    label: 'Phone',
    mask: '+1 (999) 999-9999',
    placeholder: '+1 (###) ###-####',
    validation: 'required',
    validationVisibility: 'live'
  },
]
const data = {}
</script>

<template>
  <FormKit :schema="schema" :data="data" />
</template>

Props ​

NameTypeDescription
maskstringInput mask pattern
slotCharstringSlot character
autoClearbooleanAuto clear input
unmaskbooleanReturn unmasked value
ptobjectPass-through options
ptOptionsobjectPass-through options
unstyledbooleanDisable default styles
invalidbooleanMark as invalid
variantstringVisual variant
sizestringInput size

See OpenVue InputMask docs for more details.

FormKit OpenVue Module