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 and Lodash plugins.

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 Lodash.

    Install lodash via npm

    npm i lodash
  2. Install Dropzone.

    Install dropzone via npm

    npm i dropzone
  3. 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>

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.