File Dropzone

Drag-and-drop file upload zone component.

python 7 params

Preview

Drag files here or browse
Max 10 MB

Usage

views.py
python
from djust import LiveView
from djust.components import FileDropzone


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = FileDropzone()
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
namestr'file'
labelstr''
acceptstr''
multipleboolFalse
max_size_mbint10
custom_classstr''
**kwargs— passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.file_dropzoneSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 5 of this component's classes at line 787, 791, 794, 795, 797. Override those rules, or the custom properties they read, in a stylesheet loaded after it.