0.0.95 • Published 9 months ago

input-lerna-component v0.0.95

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

updapt-input

A reusable input component for your JavaScript/Typescript React applications.

Installation

You can install the component using npm :

npm install updapt-input

Usage

To use the updapt-input component in your application, import it and include it in your JSX code:

import React, { useState } from "react";
import { UpdaptInput } from "updapt-input";

const MyForm: React.FC = () => {
  const [inputValue, setInputValue] = useState("");
  //error states
  const[error,setError] = useState(false)
// inputValue change
  const handleInputChange = (
    event: React.ChangeEvent<HTMLInputElement>
  ) => {
    const{value} = event.target
    setInputValue(value);
    setError(false);
  };
  //validation for empty fields
  const validate=()=>{
    if (!inputValue.trim()) {
      setError(true);
    } else {
      setError(false);
    }
  }
  //handle save changes
  const handleSave=()=>{
     validate()
     //API code for saving
  }
  return (
    <div>
      <h2>My Form</h2>
      <UpdaptInput
        value={inputValue}
        type="text"
        onChange={(event)=>handleInputChange(event)}
        placeholder="Enter your name"
        isError={error}
        width={180}
      />
      <p>Hello, {inputValue}!</p>
      <button onClick={()=>handleSave()}>SAVE</button>
    </div>
  );
}
```


## PROPS

The  ```updapt-input``` component accepts the following props:
PropTypeDescription
placeholderstringPlaceholder text for the input field.
valueanyThe value of the input field.
typeanytype could be any for input
isErrorbooleanif the input field is empty
widthnumberfor dynamic width which is pixels
## Contributing
Contributions are welcome! If you find any issues or want to add new features, please submit a pull request.

Before contributing, please read our contributing guidelines.

## License
This project is licensed under the MIT License. See the LICENSE file for details.

MIT &copy; [UPDAPT TEAM]()

Feel free to customize the content according to your project's requirements and specifications.
0.0.95

9 months ago

0.0.94

9 months ago

0.0.93

9 months ago

0.0.92

9 months ago

0.0.91

9 months ago

0.0.90

9 months ago

0.0.89

9 months ago

0.0.88

9 months ago

0.0.87

9 months ago

0.0.86

9 months ago

0.0.85

9 months ago

0.0.84

9 months ago

0.0.83

9 months ago

0.0.82

9 months ago

0.0.81

9 months ago

0.0.80

9 months ago

0.0.79

9 months ago

0.0.78

9 months ago

0.0.77

9 months ago

0.0.76

9 months ago

0.0.75

9 months ago

0.0.74

9 months ago

0.0.73

9 months ago

0.0.72

9 months ago

0.0.71

9 months ago

0.0.70

9 months ago

0.0.69

9 months ago

0.0.68

9 months ago

0.0.67

9 months ago

0.0.66

9 months ago

0.0.65

9 months ago

0.0.64

9 months ago

0.0.63

9 months ago

0.0.62

9 months ago

0.0.61

9 months ago

0.0.60

9 months ago

0.0.59

9 months ago

0.0.58

9 months ago

0.0.57

9 months ago

0.0.56

9 months ago

0.0.55

9 months ago

0.0.54

9 months ago

0.0.53

9 months ago

0.0.52

9 months ago

0.0.51

9 months ago

0.0.50

9 months ago

0.0.49

9 months ago

0.0.48

9 months ago

0.0.47

9 months ago

0.0.46

9 months ago

0.0.45

9 months ago

0.0.44

9 months ago

0.0.43

9 months ago

0.0.42

9 months ago

0.0.41

9 months ago

0.0.40

9 months ago

0.0.39

9 months ago

0.0.38

9 months ago

0.0.37

9 months ago

0.0.36

9 months ago

0.0.35

9 months ago

0.0.34

9 months ago

0.0.33

9 months ago

0.0.32

9 months ago

0.0.31

9 months ago

0.0.30

9 months ago

0.0.29

9 months ago

0.0.28

9 months ago

0.0.27

9 months ago

0.0.26

9 months ago

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

9 months ago

0.0.17

9 months ago

0.0.16

9 months ago

0.0.15

9 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago