@acodez/inputfield 中文文档教程
@acodez/inputfield
React 输入组件。
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";
示例 - 基本
<InputField type="text" name="name" placeholder="Your Name" />
示例- 需要,错误消息
<InputField type="email" name="email" placeholder="Your Email" required="required" errorMessage="Invalid email address" />
示例 - 输入密码(带忘记密码链接,显示/隐藏密码选项)
<InputField type="password" name="password" placeholder="Your Password" required="required" errorMessage="Invalid Password" forgotPassLink="/forgot-password" />
示例 - 大号,带标签
<InputField type="text" name="name" placeholder="Your Name" size="big" label="Your Name" />
@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" />