BASuite

BAInput

A versatile input component supporting text, password, numeric, masked, and OTP formats with built-in validation options.

Email
Password
Contact Number
Amount
OTP

Example:

 
import { BAInput } from "basuite"; 

<> 
    <BAInput label="Email" placeholder="Enter your email" validationType="email" /> 
    <BAInput label="Password" inputType="passwordinput" placeholder="Enter password" /> 
    <BAInput label="Contact Number" inputType="maskinput" mask="(###) ###-####" /> 
    <BAInput label="Amount" inputType="numericinput" prefix="$" decimalScale={2} /> 
    <BAInput label="OTP" inputType="otpinput" length={6} otpMark="*" /> 
</> 
        

Props:

NameTypeDescriptionDefault
labelstringLabel displayed above the input field.
placeholderstringPlaceholder text for the input.
disabledbooleanDisables the input.false
requiredbooleanMarks input as required.false
classNamestringCustom CSS className for styling.
onChangefunctionChange event handler.
onInputfunctionInput event handler.
onKeyDownfunctionKeyboard key press handler.
onBlurfunctionBlur event handler.
onFocusfunctionFocus event handler.
valueanyControlled value of the input.
typeanyHTML input type (default text).
inputType"numericinput" | "maskinput" | "passwordinput" | "otpinput"Determines which input variation to render.
maskstringMask format for maskinput type.
textAlign"left" | "right" | "center"Aligns text inside the input."left"
validationType"email" | "contactNumber"Built-in validation mode (currently supports email).
decimalScalenumberNumber of decimal places for numeric input.
prefixanyElement or string to render before input value.
suffixanyElement or string to render after input value.
allowNegativebooleanWhether negative numbers are allowed in numeric input.false
loadingbooleanShows a loading indicator.false
maxlengthnumberMaximum character length for input.
lengthnumberNumber of digits for OTP input.
otpMarkstringCharacter mask for OTP input fields.