1.0.8 • Published 1 year ago

drag-drop-file-tk v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

drag-drop-image-tk

Description

The drag-drop-file-tk library provides a React component for implementing drag and drop functionality for image files. This library allows users to select one or multiple image files from their computer or drag them into a designated area for preview.

Application Screenshot Application Screenshot Application Screenshot

Installation

Install the library via npm:

npm install drag-drop-file-tk

Or use yarn:

yarn add drag-drop-file-tk

Usage

Below is an example of how to use the DragDropFile component in your React application:

import React from "react";
import DragDropFile from "drag-drop-file-tk";

const App = () => {
  const handleChange = (files) => {
    // Handle selected files here
    console.log(files);
  };

  return (
    <div>
      <DragDropFile handleChange={handleChange} />
    </div>
  );
};

export default App;

Props

PropDescriptionTypeDefault
handleChangeHandler function called when a file is selected(files: File[]) => void-
or dragged and dropped.
limitLimit the number of files that can be selected.number-
placeholderPlaceholder for the drag and drop area.string-
titleTitle of the drag and drop area.string-
clearTitleTitle for the clear selected image button.string'Clear image'
withImagePreviewWidth of the image preview.number-
heightImagePreviewHeight of the image preview.number-
messageLimitMessage when exceeding the file limit.string-
showMessageLimitEnable displaying a message when exceedingboolean-
the file limit.
defaultPreviewDefault image previewstring[]-
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago