Components
Input

Input

Import

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

Size

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

Color

The Input 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 input 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
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 -