File Upload

Medium

Drag-and-drop file upload with progress indicators and file type validation

Updated about 1 month ago
Tested & Responsive

Live Demo

Basic File Upload

Simple file upload with click-to-browse functionality

Simple
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Basic File Upload Overview

Simple file upload with click-to-browse functionality

Complexity: Medium

💡 Key Features

  • • Basic File Upload functionality with Stimulus controller
  • • Input fields, selects, checkboxes, and form validation components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with file capabilities
  • • Enhanced with upload capabilities
  • • Enhanced with drag-drop capabilities
  • • Enhanced with progress capabilities
  • • Enhanced with validation capabilities
  • • Enhanced with multiple capabilities

Drag & Drop Upload

Drag and drop file upload with visual feedback

Medium
Preview:
Desktop view

Drop files here

or click to browse

Supports images, PDFs, and documents

Images Documents

Resize to see how the component adapts to different screen sizes

📖 Drag & Drop Upload Overview

Drag and drop file upload with visual feedback

Complexity: Medium

💡 Key Features

  • • Drag & Drop Upload functionality with Stimulus controller
  • • Input fields, selects, checkboxes, and form validation components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with file capabilities
  • • Enhanced with upload capabilities
  • • Enhanced with drag-drop capabilities
  • • Enhanced with progress capabilities
  • • Enhanced with validation capabilities
  • • Enhanced with multiple capabilities

Multiple Files

Upload multiple files with individual progress and preview

Medium
Preview:
Desktop view

Multiple File Upload

0 / 5 files selected

Select up to 5 files

Supported: Images, PDFs, Documents, Text files

Click on files to add more, or remove individual files using the × button

Resize to see how the component adapts to different screen sizes

📖 Multiple Files Overview

Upload multiple files with individual progress and preview

Complexity: Medium

💡 Key Features

  • • Multiple Files functionality with Stimulus controller
  • • Input fields, selects, checkboxes, and form validation components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with file capabilities
  • • Enhanced with upload capabilities
  • • Enhanced with drag-drop capabilities
  • • Enhanced with progress capabilities
  • • Enhanced with validation capabilities
  • • Enhanced with multiple capabilities

File Validation

File type and size validation with error messages

Medium
Preview:
Desktop view

File Upload with Validation

Upload files with strict validation rules

⚠️ Strict validation enabled

Files will be checked against all requirements

Valid files will show in green, invalid files in red with error details

💡 Testing Tips:

  • • Try uploading a file larger than 2MB to see size validation
  • • Upload a .txt or .doc file to see type validation
  • • Upload more than 3 files to test count limits
  • • Valid files: JPG, PNG, GIF, PDF under 2MB

Resize to see how the component adapts to different screen sizes

📖 File Validation Overview

File type and size validation with error messages

Complexity: Medium

💡 Key Features

  • • File Validation functionality with Stimulus controller
  • • Input fields, selects, checkboxes, and form validation components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with file capabilities
  • • Enhanced with upload capabilities
  • • Enhanced with drag-drop capabilities
  • • Enhanced with progress capabilities
  • • Enhanced with validation capabilities
  • • Enhanced with multiple capabilities

Installation & Usage

1

Copy the ERB template

Copy the ERB code from the template tab above and paste it into your Rails view file.

2

Add the Stimulus controller

Create the Stimulus controller file in your JavaScript controllers directory.