1.1.1 • Published 5 months ago

react-input-fields v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-input-fields

A React package for easily handling file input fields, supporting various file types such as images, videos, and other files. It allows users to upload files via drag-and-drop or the standard file input interface.

Features

FeatureDescription
Drag-and-Drop UploadSupports drag-and-drop file upload.
Multiple File Types SupportedAccepts images, videos, and other file types.
Minimal SetupEasy-to-use with React and minimal setup.

Installation

You can install the react-input-fields package via npm:

npm install react-input-fields


How to Use
Basic Usage of ImageInput Component
The package provides an easy-to-use ImageInput component that allows users to upload images through drag-and-drop or standard file input.

## Example

Here’s how to use the `ImageInput` component in your React project:

| Input Type | Component     | Props                                                                          |
|-------------------------|-----------------------|--------------------------------------------------------------------------------|
| Image     | `<ImageInput />` | `{ width = "100%", height = "auto", inputName = "image", color = "#FFA500", background = "#808080" }` |

Import the Component: Import the ImageInput component from react-input-fields into your React component.

Render the Input: Use the ImageInput component in your JSX to allow users to upload their images.


Component Props
Prop	Type	Description	Default Value
onChange	function	Callback function when a file is selected.	null
color	string	The color of the border and text during drag.	"#FF6347"
background	string	The background color of the input field.	"#f0f0f0"
width	string	The width of the input field.	"100%"
height	string	The height of the input field.	"auto"
1.1.1

5 months ago

1.1.0

5 months ago

1.0.3

5 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago