New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

input-lerna-component

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-lerna-component

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

latest
Source
npmnpm
Version
0.0.95
Version published
Maintainers
1
Created
Source

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.



FAQs

Package last updated on 17 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts