@acodez/inputfield
React input component.
Installation
npm install @acodez/inputfield
Props API
Property | Type | Required | Description |
---|
type | string | yes | input type, text , password , email |
size | string | no | size (height) of the input, nomral or big |
label | string | no | label of input, shoown above the input field |
errorMessage | string | no | error message |
forgotPassLink | string | no | Forgot Password link for password field |
Usage
import InputField from "@acodez/inputfield";
Example - Basic
<InputField type="text" name="name" placeholder="Your Name" />
Example - With required, error message
<InputField type="email" name="email" placeholder="Your Email" required="required" errorMessage="Invalid email address" />
Example - Type password (with forgot password link, show/hide password option)
<InputField type="password" name="password" placeholder="Your Password" required="required" errorMessage="Invalid Password" forgotPassLink="/forgot-password" />
Example - Size big, with label
<InputField type="text" name="name" placeholder="Your Name" size="big" label="Your Name" />