Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (29 sloc) 1.47 KB

Image Input Preview (Demo)

Display a preview for your image inputs easily


  • Installation

Simply import image-input-preview into your HTML.

<link rel="stylesheet" type="text/css" href="">
<script src=""></script>
  • Documentation

See the offical documentation for more in-depth informations.

  • How to use

You can either use data attributes or the ImageInputAttribute class to initialyze your inputs:

<input type="file" accept="image/*" data-preview="">
// OR
let preview = new ImageInputPreview(input, {
  preview: '',        // Optional | Preview displayed
  uploadIcon: '', // Optional | Icon used when no preview is displayed
  lang: 'en',                                         // Optional | Language used
  dictionary: null                                    // Optional | Allow for custom language
  • Methods

See the documentation for the method definitions.

  • Example

See this JSFiddle for a working example


You can’t perform that action at this time.