File uploader

Component for uploading any file type with built-in validation and image optimization.

Finder component
You can alter file uploader behaviour via attributes that should be added to <input type="file" class="file-uploader">.
  • multiple — Allows multiple files upload (Core plugin).
  • accept="image/png, image/jpeg, video/mp4..." — Specify what file types to accept (File type validation plugin).
  • data-style-panel-layout="compact" — Image preview will take up the full width and height of the file uploader component.
  • data-max-file-size="100KB" — Maximum file size allowed (File size validation plugin).
  • data-max-files="5" — Maximum number of files per one upload (Core plugin).
  • data-label-idle — String or HTML. Label that should be displayed in idle state of the file uploader component (Core plugin).
  • data-image-preview-height — Number. Maximum height of the preview image (Image preview plugin).
  • data-image-crop-aspect-ratio="1:1" — Crops the image to a certain aspect ratio (Image crop plugin).
  • data-image-resize-target-width — Number. Resizes the image to a certain width (Image resize plugin).
  • data-image-resize-target-height — Number. Resizes the image to a certain height (Image resize plugin).
Modifier classes:
  • file-uploader-grid — Turns image previews in a grid as opposed to list by default.
Plugin documentation:https://pqina.nl/filepond/docs/

Single file upload: Image only + Cropped + Resized (Profile picture)

<!-- Single file upload: Image only + Cropped + Resized (Profile picture) -->
<input class="file-uploader bg-secondary" type="file" accept="image/png, image/jpeg" data-label-idle='<i class="d-inline-block fi-camera-plus fs-2 text-muted mb-2"></i><br><span class="fw-bold">Change picture</span>' data-style-panel-layout="compact" data-image-preview-height="160" data-image-crop-aspect-ratio="1:1" data-image-resize-target-width="200" data-image-resize-target-height="200">

<!-- Light skin -->
<input class="file-uploader border-light bg-faded-light" type="file" accept="image/png, image/jpeg" data-label-idle='<i class="d-inline-block fi-camera-plus fs-2 text-light mb-2"></i><br><span class="fw-bold text-light opacity-70">Change picture</span>' data-style-panel-layout="compact" data-image-preview-height="160" data-image-crop-aspect-ratio="1:1" data-image-resize-target-width="200" data-image-resize-target-height="200">
// Single file upload: Image only + Cropped + Resized (Profile picture)
input(type="file", accept="image/png, image/jpeg", data-label-idle='<i class="d-inline-block fi-camera-plus fs-2 text-muted mb-2"></i><br><span class="fw-bold">Change picture</span>', data-style-panel-layout="compact", data-image-preview-height="160", data-image-crop-aspect-ratio="1:1", data-image-resize-target-width="200", data-image-resize-target-height="200").file-uploader.bg-secondary

// Light skin
input(type="file", accept="image/png, image/jpeg", data-label-idle='<i class="d-inline-block fi-camera-plus fs-2 text-light mb-2"></i><br><span class="fw-bold text-light opacity-70">Change picture</span>', data-style-panel-layout="compact", data-image-preview-height="160", data-image-crop-aspect-ratio="1:1", data-image-resize-target-width="200", data-image-resize-target-height="200").file-uploader.border-light.bg-faded-light
Top