@acodez/inputfield 中文文档教程

发布于 3年前 浏览 19 更新于 3年前

@acodez/inputfield

npm_version license

React 输入组件。



Installation

npm install @acodez/inputfield

Props API

PropertyTypeRequiredDescription
typestringyesinput type, text, password, email
sizestringnosize (height) of the input, nomral or big
labelstringnolabel of input, shoown above the input field
errorMessagestringnoerror message
forgotPassLinkstringnoForgot 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

npm_version license

React input component.



Installation

npm install @acodez/inputfield

Props API

PropertyTypeRequiredDescription
typestringyesinput type, text, password, email
sizestringnosize (height) of the input, nomral or big
labelstringnolabel of input, shoown above the input field
errorMessagestringnoerror message
forgotPassLinkstringnoForgot 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" />
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文