Upload Zone

Drag and drop or

Your file should not exceed 50MB.
Attribute Type Documentation Default Value
Required id * :string

The unique identifier for the component.

type :atom

The type of file to accept.

src :string

The existing url or file name to display.

errors :list

The list of errors.

[]
size :string

The size of the upload zone.

"base"
consume_after_upload :boolean

Whether to consume the uploaded file after upload. When true, the form will be reset after the file is uploaded.

false
Required upload_callback * {:fun, 1}

The callback to be called when the file is uploaded.

success_message :string

Flash message to display on successful upload. Set to false to disable.

"Upload successful"
accepted_file_extensions :list

The list of accepted file extensions to override the default.

label :string

The input label to display above the upload zone. Marked as optional by default.

required :boolean

Whether to mark the label as required instead of optional.

false