KarimMokhtar / react-drag-drop-files

Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
245 stars 86 forks source link

Dropzone size #97

Open CoderShiun opened 1 year ago

CoderShiun commented 1 year ago

Hi, I am new in frontend, first thanks for your library, its so handy. I have tried to change the size of the dropzone and icon but it does not work, maybe someone could give me a hint? thanks!

cplanck commented 1 year ago

Hi,

You need to add a children prop with a JSX element that is custom styled for the drop area. Something like:

<FileUploader
        multiple={false}
        handleChange={handleChange}
        name="file"
        types={fileTypes}
        children={boxArea}
      />

Where const boxArea = <div className='dropArea'>Add file </div>

You can then style the class dropArea how ever you want in your style sheet.