Dropzone
Basic Usage
Drag & drop a file here, or browse
Images only · Max 10MB
<neura::dropzone />
With Label and Description
Upload a profile picture. JPG, PNG or GIF. Max 5MB.
Drag & drop a file here, or browse
Images only · Max 10MB
<neura::dropzone
label="Profile Picture"
description="Upload a profile picture. JPG, PNG or GIF. Max 5MB."
/>
Single File Upload
Select a single document to upload
Drag & drop a file here, or browse
Images only · Max 10MB
<neura::dropzone
label="Upload Document"
:multiple="false"
/>
Multiple Files Upload
Select multiple images to upload
Drag & drop files here, or browse
Images only · Max 10MB
<neura::dropzone
label="Upload Images"
:multiple="true"
/>
File Type Restrictions
Images Only (Default)
Drag & drop a file here, or browse
Images only · Max 10MB
PDF Only
Only PDF files are allowed
Drag & drop a file here, or browse
All files · Max 10MB
Multiple File Types
PDF, Word documents, or text files
Drag & drop a file here, or browse
All files · Max 10MB
<!-- Images only -->
<neura::dropzone accept="image/*" />
<!-- PDF only -->
<neura::dropzone accept=".pdf" />
<!-- Multiple types -->
<neura::dropzone accept=".pdf,.doc,.docx,.txt" />
File Size Limit
Maximum file size: 5MB
Drag & drop a file here, or browse
Images only · Max 5MB
<neura::dropzone
label="Upload File"
:maxSize="5"
description="Maximum file size: 5MB"
/>
Without Preview
Files will be uploaded without preview
Drag & drop a file here, or browse
Images only · Max 10MB
<neura::dropzone
:preview="false"
/>
Without Remove Button
Files cannot be removed after selection
Drag & drop a file here, or browse
Images only · Max 10MB
<neura::dropzone
:removable="false"
/>
With Livewire
Drag & drop files here, or browse
Images only · Max 10MB
<neura::dropzone
wire:model="photos"
:multiple="true"
/>
<!-- In your Livewire component -->
#[Validate(['photos.*' => 'image|max:2048'])]
public $photos = [];
With Form Validation
Upload your profile picture
Drag & drop a file here, or browse
Images only · Max 2MB
<form method="POST" action="/upload" enctype="multipart/form-data">
<neura::dropzone
name="avatar"
label="Profile Avatar"
accept="image/*"
:maxSize="2"
/>
<button type="submit">Submit</button>
</form>
Use Cases
Profile Picture Upload
Upload a square profile picture. Recommended size: 400x400px
Drag & drop a file here, or browse
Images only · Max 2MB
Document Gallery
Drag and drop multiple documents or click to browse
Drag & drop files here, or browse
All files · Max 10MB
Image Gallery
Upload multiple images to create a gallery
Drag & drop files here, or browse
Images only · Max 5MB
Best Practices
✓ Do
- Always specify accepted file types with the accept attribute
- Set a reasonable maximum size to avoid overly large uploads
- Add clear labels and descriptions to guide the user
- Use server-side validation in addition to client-side validation
- Enable preview for images to improve user experience
✗ Don't
- Don't accept all file types without restriction (accept="*")
- Don't set a maximum size that's too high and could overload the server
- Don't forget server-side validation even if client-side validation exists
- Don't use without label or description if the context is not obvious
- Don't allow uploading files that are too large without warning the user
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| name | string|null | null | Field name for form validation |
| accept | string | 'image/*' | Accepted file types (e.g., 'image/*', '.pdf', '.pdf,.doc') |
| maxSize | int | 10 | Maximum file size in MB |
| multiple | bool | false | Allow uploading multiple files |
| preview | bool | true | Display preview of uploaded files |
| removable | bool | true | Display remove button for each file |
| label | string|null | null | Label displayed above the dropzone |
| description | string|null | null | Description displayed below the label |
| invalid | bool|null | null | Error state (automatically detected if name is provided) |