Socket
Socket
Sign inDemoInstall

image-input-preview

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-input-preview

Display a preview for your image inputs easily


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Image Input Preview (Demo)

Display a preview for your image inputs easily

Doc

  • Installation

Simply import image-input-preview into your HTML.

<link rel="stylesheet" type="text/css" href="https://gitcdn.link/repo/Zenoo/image-input-preview/master/ImageInputPreview.min.css">
<script src="https://gitcdn.link/repo/Zenoo/image-input-preview/master/ImageInputPreview.min.js"></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="https://link.to.your.preview.net">
// OR
let preview = new ImageInputPreview(input, {
  preview: 'https://link.to.your/preview.png',        // Optional | Preview displayed
  uploadIcon: 'https://link.to.your.upload/icon.png', // 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

Authors

Keywords

FAQs

Package last updated on 13 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc