InputMask

InputMask component is used to enter input in a certain format such as numeric, date, currency and phone.

InputMask is used as a controlled input with v-model property.

PREVIEW

InputMask is used as a controlled input with v-model property.

basic-demo

Mask format can be a combination of the following definitions; a for alphabetic characters, 9 for numeric characters and * for alphanumberic characters. In addition, formatting characters like (, ) , - are also accepted.

SSN
Phone
Serial Number
mask-demo

When the input does not complete the mask definition, it is cleared by default. Use autoClear property to control this behavior. In addition, ? is used to mark anything after the question mark optional.

optional-demo

Default placeholder for a mask is underscore that can be customized using slotChar property.

slotchar-demo

Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.

filled-demo

FloatLabel visually integrates a label with its form element. Visit FloatLabel documentation for more information.

floatlabel-demo

IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.

iftalabel-demo

InputMask provides small and large sizes as alternatives to the base.

sizes-demo

The fluid prop makes the component take up the full width of its container when set to true.

fluid-demo

When disabled is present, the element cannot be edited and focused.

disabled-demo

The invalid state is applied using the invalid property to indicate failed validation, which can be integrated with form validation.

invalid-demo

InputMask integrates seamlessly with the PrimeVue Forms library.

forms-demo

Screen Reader

InputMask component renders a native input element that implicitly includes any passed prop. Value to describe the component can either be provided via label tag combined with id prop or using aria-labelledby, aria-label props.

Keyboard Support

KeyFunction
tabMoves focus to the input.
Theme Designer