Actions
JS behaviour
File drop
A dropzone that feeds dropped files into its input; with wire:model and WithFileUploads the list underneath tracks each file’s progress.
Real scenarios
The component as it is used in a product — not a specimen grid.
A document checklist
Drop the files anywhere on the field — they land in the queue with their size; the drag state lights the rim. This form posts them natively.
One avatar, its own words
title replaces the built-in invitation and accept filters what the file picker offers — single file, no multiple.
Accessibility
- The whole zone is a real <label> wrapping a native file input — keyboard and screen readers work out of the box.
- Dropping simply forwards to the input, so your validation sees one source of truth.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| title | string | null | The invitation line; the built-in bilingual default is “Drop files or :browse” with the browse word underlined. |
| hint | string | null | The small helper line under the invitation — formats and size limits. |
| (ویژگیهای input) | attrs | — | Any attribute (wire:model, multiple, accept, name…) lands on the file input itself. |
Snippet
<x-nx::file-drop wire:model="attachments" multiple hint="PDF تا ۲۰ مگابایت" />