File Upload live · Anatomy
LiveView uploads (allow_upload) and Corex.FileUploadLive.
Minimal
<form phx-change="validate">
<.file_upload_live upload={@uploads.document} field={:document} class="file-upload">
<:close>
<.heroicon name="hero-x-mark" />
</:close>
</.file_upload_live>
</form>
With label
<form phx-change="validate">
<.file_upload_live upload={@uploads.document} field={:document} class="file-upload">
<:label>Files</:label>
<:close>
<.heroicon name="hero-x-mark" />
</:close>
</.file_upload_live>
</form>
Custom slots
<form phx-change="validate">
<.file_upload_live upload={@uploads.document} field={:document} class="file-upload">
<:dropzone>
<span>Custom dropzone</span>
</:dropzone>
<:open>
<span>Custom trigger</span>
</:open>
<:close>
<.heroicon name="hero-x-mark" />
</:close>
</.file_upload_live>
</form>