Search code examples
reactjsfile-uploaddrag-and-drop

How to specify height and width using react-drag-drop-file?


I'm using react-drag-drop-files package for file upload on my website, however I don't see any options on how to specify height and width in the documentation. Currently the object looks like this, but I want to make it taller.

enter image description here

Is there a way to do so or do I have to use a different package for file uploads?


Solution

  • You can use the classes prop and add a class to the component and then use that class to style the component with css.

      <FileUploader
        classes="custom-fileUploader"
        multiple={true}
        handleChange={handleChange}
        name="file"
        types={fileTypes}
      />
    

    Now just give .custom-fileUploader the height (and any other style) you want and make the component taller.