@pikooli/react-prev-img
TypeScript icon, indicating that this package has built-in type declarations

1.0.15 • Public • Published

react-prev-img

A react image picker with preview

It let you pick files from your computer and display only the first one.

Install :

npm install react-prev-img

How to use it :

import ReactPrevImg from "@pikooli/react-prev-img";

const Component = () => {

  const [files, setFiles] = useState({});

  return (
    <ReactPrevImg files={files.files} setFiles={setFiles} />
  )}

You can pass additional options.

Accepted props :

Props Type Optional ? Description
width Number yes width of the display preview
height Number yes height of the display preview
className string yes class of the preview
accept string yes type accepted for input
max string yes max number of file
files File no files selected
setFiles Function no set selected files

License

Under the MIT license.

/@pikooli/react-prev-img/

    Package Sidebar

    Install

    npm i @pikooli/react-prev-img

    Weekly Downloads

    0

    Version

    1.0.15

    License

    ISC

    Unpacked Size

    22.8 kB

    Total Files

    17

    Last publish

    Collaborators

    • pikooli