Components
Input Mask

Input Mask

Import

import { VKInputMask } from "@vivakits/react-components";

Mask

The component must be provided with using mask where digit groups (9) or character groups (a) are separated by preferred delimeter.

Placeholder

The component can have a placeholder text using the placeholder prop. The placeholder text will be displayed when the input field is empty.

Slot character

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

Auto Clear

When the input does not complete the mask definition, it is cleared by default. Use autoClear property to control this behavior

Size

The InputMask component comes with 4 different sizes that you can change using the size prop.

Color

The InputMask component comes with 6 different colors that you can change it using the color prop. It has both solid and outline variant.

Rounded

The shape of the inputMask component can be updated using rounded prop.

Icon

An icon can be appended or prepended using icon prop. The position of the icon can be specified by the iconPosition prop.

📅
📅

Error

Conditional error handling for input can be done via hasError prop. Error message can also be modified via errorMessage prop.

Invalid input value
Custom error message

API Reference

AttributeTypeDescriptionDefault
maskstringMask pattern
onChangefunctionCallback function to get the value of the input field
placeholderstringMask for the input field
slotCharstringPlaceholder character in mask_
autoClearbooleanClears the incomplete value on blurtrue
colorprimarysecondaryaccentsuccesswarningdangerChanges input colorprimary
sizesmmdlgxlChanges input sizemd
roundeddefaultnonexssmmdlgfulllChanges the border radius of inputprimary
iconReactNodeAppend or prepend an icon inside the input box -
iconPositionstartendDetermine the position of the icon start
placeholderstringPlace a text inside the input box -
labelstringlabel of the input box -
labelPositionstartendhorizontalDetermine the position of the label of input box start
labelClassNamestringChanges style of the label of input box -
hasErrorbooleanShows error false
errorMessagestringModify the error messageInvalid input value
wrapperClassNamestringModify the appearance of input box -