PhoenixKitWeb.Components.Core.FileUpload (phoenix_kit v1.6.15)
View SourceReusable file upload component for PhoenixKit.
Provides a simple file upload button with auto-upload functionality. Files are uploaded immediately upon selection without requiring a submit button.
Usage
<.file_upload
upload={@uploads.media_files}
label="Upload Media"
/>Attributes
upload(required) - LiveView upload config from allow_upload/3label(optional) - Button label (default: "Upload Files")icon(optional) - Icon name (default: "hero-cloud-arrow-up")accept_description(optional) - Text describing accepted file typesmax_size_description(optional) - Text describing max file size
Summary
Functions
Attributes
upload(:any) (required)label(:string) - Defaults to"Upload Files".icon(:string) - Defaults to"hero-cloud-arrow-up".accept_description(:string) - Defaults tonil.max_size_description(:string) - Defaults tonil.uploaded_file_ids(:list) - List of file IDs from last upload (for external use). Defaults tonil.variant(:string) - Display variant - 'full' for drag-drop zone, 'button' for simple button only. Defaults to"full".