File Dropzone
Drag-and-drop file upload zone component.
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
| Name | Type | Default |
|---|---|---|
| name | str | 'file' |
| label | str | '' |
| accept | str | '' |
| multiple | bool | False |
| max_size_mb | int | 10 |
| custom_class | str | '' |
| **kwargs | — passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.file_dropzone | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 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. |