0.1.4 • Published 2 years ago

@flexcodelabs/input v0.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@flexcodelabs/input

npm NPM

Package Name

Features

  • List of features

Installation

npm install @flexcodelabs/input

or

yarn add @flexcodelabs/input

Usage

...
import Input from '@flexcodelabs/input';

// Normal input
<Input
  label="Label"
  value={email}
  name="email"
  onChange={onChange}
  placeholder="Label"
/>

// password input
<Input
  label="Password"
  value={password}
  type="password"
  name="password"
  onChange={onChange}
  placeholder="********"
/>

// textarea
<Input
  label="Your Message"
  textarea
  value={message}
  handleChange={onChange}
  name="message"
/>

// Input with error message
<Input
  label="Label"
  value={email}
  name="email"
  onChange={onChange}
  placeholder="Label"
  error="Error message"
/>

// Input with success message
<Input
  label="Label"
  value={email}
  name="email"
  onChange={onChange}
  placeholder="Label"
  success="Success message"
/>

Examples

Source code

Props

NameTypeDefaultRequiredDescription
labelstring-falseinput label
disabledboolean-falseinput disabled status
autoCompletestring-false
inputClassstring-falseinput custom class name
inputStyleCSSProperties-falseinput custom styles
errorstring-falseerror message
onChangefunc()-false
typestring-falseinput type
successstring-falsesuccess message
valuestring or number-trueinput value
namestring-falseinput name
requiredboolean-falsewhether input field is required
showLabelbooleantruefalseshow or hide input label
textareaboolean-falsewhether to display textarea or normal input
placeholderstring-false
showIconReactNode-falseshow icon for password input field
hideIconReactNode-falsehide icon for password input field
classNamestring-falsecustom class name
styleCSSProperties-falsecustom styles
inputModesearch, text, tel, none, url, email, numeric, decimal or undefined-false
0.1.4

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago