ImagePreview

ImagePreview Stimulus Controller

Provides real-time image preview functionality for file upload forms. Creates object URLs for selected images and displays them immediately for better user experience during file selection.

Features:

  • Instant image preview on file selection
  • Object URL creation and management
  • Loading state management
  • Preview visibility control
  • Automatic cleanup of resources

Targets:

  • file: File input element for image selection
  • preview: Image element for displaying preview
  • loading: Loading indicator element

Usage:

Loading...