0.1.4 • Published 6 years ago

img-preview v0.1.4

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

ImgPreview

npm.io NPM version NPM downloads

Introduce

Picture preview components, click to full screen display, support for zoom in, drag and other operations.

Install

$ npm install img-preview --save

Usage

import ImgPreview from 'img-preview';
...
class AgentList extends Component {
  ...
  render(){
    return (
      <div>
        <ImgPreview src='url'/>
        <ImgPreview src={[url0, url1, url2]}/>
        <ImgPreview
          render={(t) => <a href={t.url}>t.name</a>}
          src={[
            {
              url: '111',
              name: '111,
            }, {
              url: '222',
              name: '222,
            },{
              url: '333',
              name: '333,
            },
          ]}
        />
      </div>
  }
}

Configuration

  • src: support array or string (url address)
  • render: custom rendering list style
  • emptyText: support string or react component, display when src's length === 0

Note: When using render, src must be array type, each array must be object type and have src attribute, detail to see demo.

Features

  • Automatically generate preview thumbnails
  • Click on the thumbnail pop-up big picture
  • Support custom list style
  • Support zoom in, rotate, drag and other operations

Overview

Thumbnail list

image

Detail

image

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago