Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize Dropzone js?

How do I customize Dropzone js? I searched for hours, but only gone in loops. I'm trying to go from this...enter image description here

To something like this...enter image description here

I don't need the background or any fancy styles, and the functionality already works. I Just mainly need the files to be like they are in the red box. But I don't know where to start.

Here is my main.js and css I used to style what you see in the first picture...

Dropzone.autoDiscover = false;

const myDropzone = new Dropzone("#my-dropzone", {
    url: "upload/",
    maxFiles: 2,
    maxFilesize: 20,
    acceptedFiles: '.csv, .xlsx',
    preview_image: false,
    inputLabelWithFiles: false,
    // autoProcessQueue: false,
    // uploadMultiple: True,
    // previewTemplate: '',
})
body {
    background-color: #f8f8f8;
}

.dz {
    border: dashed !important;
    border-color: #ccc !important;
    border-radius: 10px !important;
}

.dz:hover {
    background-color: aliceblue !important;
}
like image 868
Three Point 14 Avatar asked Jan 21 '26 17:01

Three Point 14


1 Answers

You could check this article

 new Dropzone(target, {
        ... 
        previewTemplate: previewTemplate,
        previewsContainer: "#previews",

Also, in the documentation

like image 111
A. El-zahaby Avatar answered Jan 23 '26 07:01

A. El-zahaby