Search 71 components and 72 controllers by name, category or description.
File Upload
App-integrated drag-and-drop uploader with progress and JSON or Turbo Stream output
Dropzone upload
Managed JSON in isolation with attachment cards, hidden values, removal, Clear all and retry for 5xx responses.
<hw:file-upload
name="attachments"
url="/uploads"
view="list"
multiple
:max-files="3"
accept="image/*"
/>
Output modes
preview renders cards only, hidden writes values only, and none leaves both outputs to the application.
{{-- preview: cards only, no form values --}}
<hw:field name="preview_attachments" label="Preview only">
<hw:file-upload
name="preview_attachments"
url="/uploads"
output-mode="preview"
multiple
:max-files="3"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
</hw:field>
{{-- hidden: form values only, no cards --}}
<hw:field name="hidden_attachments" label="Hidden values only">
<hw:file-upload
name="hidden_attachments"
url="/uploads"
output-mode="hidden"
multiple
:max-files="3"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
</hw:field>
{{-- none: the application owns both outputs, driven by the controller events --}}
<hw:field name="event_attachments" label="Application-owned output">
<hw:file-upload
name="event_attachments"
url="/uploads"
output-mode="none"
multiple
:max-files="3"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
</hw:field>
Inside a Modal
The default and bare custom dropzones must keep the Modal open while picking, dropping, retrying and removing files.
Upload from a Modal
Exercise keyboard and drag/drop interactions without closing the overlay.
<hw:field name="modal_attachments" label="Default dropzone">
<hw:file-upload
name="modal_attachments"
url="/uploads"
multiple
:max-files="2"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
</hw:field>
{{-- dropzone-variant="bare" hands the whole surface to the x-slot:dropzone markup --}}
<hw:field name="modal_custom_attachments" label="Bare custom dropzone">
<hw:file-upload
name="modal_custom_attachments"
url="/uploads"
multiple
:max-files="2"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
dropzone-variant="bare"
>
<x-slot:dropzone
class="flex min-h-32 items-center justify-center rounded-xl border border-dashed p-4 text-center outline-none transition data-[dragging=true]:border-primary data-[upload-state=error]:border-destructive focus-visible:ring-2 focus-visible:ring-ring"
aria-label="Choose images from the Modal"
>
<span class="flex items-center gap-2">
<hw:icon name="file-up" class="size-4" />
Choose images
</span>
</x-slot:dropzone>
</hw:file-upload>
</hw:field>
Inside a Dropdown
close-on-select is disabled so uploader controls do not dismiss either dropzone workflow.
{{-- close-on-select="false" keeps the menu open while the uploader controls are used --}}
<hw:dropdown :close-on-select="false">
<hw:dropdown.trigger>
Open upload Dropdown
<hw:dropdown.trigger-icon>
<hw:icon name="chevron-down" aria-hidden="true" />
</hw:dropdown.trigger-icon>
</hw:dropdown.trigger>
<hw:dropdown.content align="start" width="w-96 max-w-[calc(100vw-2rem)]">
<div class="space-y-6 p-2">
<hw:field name="dropdown_attachments" label="Default dropzone">
<hw:file-upload
name="dropdown_attachments"
url="/uploads"
multiple
:max-files="2"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
</hw:field>
<hw:field name="dropdown_custom_attachments" label="Bare custom dropzone">
<hw:file-upload
name="dropdown_custom_attachments"
url="/uploads"
multiple
:max-files="2"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
dropzone-variant="bare"
>
<x-slot:dropzone
class="flex min-h-24 items-center justify-center rounded-lg border border-dashed p-4 text-center outline-none transition data-[dragging=true]:border-primary data-[upload-state=error]:border-destructive focus-visible:ring-2 focus-visible:ring-ring"
aria-label="Choose images from the Dropdown"
>
<span class="flex items-center gap-2">
<hw:icon name="file-up" class="size-4" />
Choose images
</span>
</x-slot:dropzone>
</hw:file-upload>
</hw:field>
</div>
</hw:dropdown.content>
</hw:dropdown>
Inside a Turbo Frame
Reload the frame during or after an upload to exercise disconnect, morph and reconnect cleanup.
<hw:frame id="file-upload-smoke-frame" refresh="morph" class="block space-y-4 rounded-lg border p-4">
<hw:file-upload
name="frame_attachments"
url="/uploads"
multiple
:max-files="3"
:max-size-bytes="2 * 1024 * 1024"
accept="image/*"
density="compact"
/>
{{-- Reloading the frame exercises disconnect, morph and reconnect cleanup --}}
<hw:button as="a" href="{{ url()->current() }}" frame="file-upload-smoke-frame" variant="outline" size="sm">
Reload frame
</hw:button>
</hw:frame>
Gallery with Turbo Stream
The raw Turbo Stream response owns the server-rendered cards and form values.
{{-- mode="turbo-stream" hands the response to Turbo: the server renders the cards and the form values --}}
<hw:field name="media_ids" label="Gallery with Turbo Stream">
<hw:file-upload
name="media_ids"
:url="route('posts.media.store', $post)"
mode="turbo-stream"
multiple
accept="image/*"
:max-size-bytes="10 * 1024 * 1024"
:messages="['idleMultiple' => 'Drop images or click to upload']"
/>
</hw:field>
<hw:attachment.group id="post-media-gallery" class="flex-row flex-wrap">
@foreach ($mediaItems as $media)
@include('posts._media-card', ['post' => $post, 'media' => $media, 'formId' => 'post-form'])
@endforeach
</hw:attachment.group>
<hw:form id="post-form" :action="route('toast')" method="post" class="mt-4 flex justify-end">
<input type="hidden" name="type" value="success">
<input type="hidden" name="message" value="Gallery saved">
<hw:button type="submit" variant="outline" size="sm">Save gallery</hw:button>
</hw:form>
Image surfaces
Local and durable previews must retain the circular avatar and horizontal 3:1 banner geometries.
{{-- view="image" replaces the file list with an in-place preview of the dropzone slot --}}
<hw:field name="avatar_token" label="Profile photo">
<hw:file-upload
name="avatar_token"
:url="route('uploads.avatar')"
view="image"
:max-size-bytes="2 * 1024 * 1024"
>
<x-slot:dropzone
class="rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
aria-label="Change profile photo"
>
<hw:avatar name="Laravel Hotwire" size="lg" />
</x-slot:dropzone>
</hw:file-upload>
</hw:field>
{{-- The slot decides the geometry: local previews and durable URLs both inherit it --}}
<hw:field name="banner_token" label="Profile banner">
<hw:file-upload
name="banner_token"
:url="route('uploads.avatar')"
view="image"
:max-size-bytes="2 * 1024 * 1024"
>
<x-slot:dropzone
class="w-full rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
aria-label="Change profile banner"
>
<div class="flex aspect-[3/1] w-full items-center justify-center rounded-xl bg-muted text-sm text-muted-foreground">
Drop a 3:1 banner
</div>
</x-slot:dropzone>
</hw:file-upload>
</hw:field>