1. Components
  2. FileUpload

Third-Party Plugins

Tailwind CSS File Upload

File Upload enhances web forms with a Tailwind CSS-compatible, user-friendly interface that supports drag-and-drop, previews, and progress bars. It allows simultaneous multiple file uploads with options for automatic or manual submission and validation of file types and sizes.

Requires Additional Installation

Note that this component requires the use of the third-party Dropzone plugin.

Requires JS

Note that this component requires the use of Preline UI's File Upload plugin, else you can skip this message if you are already using Preline UI as a package.

How to use

  1. Install Dropzone.

    Install dropzone via npm

    npm i dropzone
  2. Add Lodash and Dropzone to the page.

    Include the JavaScript <script> near the end of your </body> tag:

    <script src="./node_modules/lodash/lodash.min.js"></script><script src="./node_modules/dropzone/dist/dropzone-min.js"></script>

    Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

Example

Using the most basic file upload markup, here's how file upload look.

Drop your file here or browse

Pick a file up to 2MB.

Error

Error handling. Will throw an error if the file size exceeds 1 MB.

Drop your file here or browse

Pick a file up to 2MB.

Using file upload as a gallery.

Single Image Upload

Using file upload as a single image upload.

Input File

Using file upload as a simple file upload.