MinJieLiu / react-photo-view

An exquisite React photo preview component.
https://react-photo-view.vercel.app
Apache License 2.0
1.56k stars 130 forks source link
gallery gallery-images image image-preview image-swipe photo photo-swipe react react-component

react-photo-view

English | 中文

An exquisite React photo preview component.

NPM version Downloads Minified size Gzip size

example

Quick start

features

Install

yarn add react-photo-view

Basic usage:

import { PhotoProvider, PhotoView } from 'react-photo-view';
import 'react-photo-view/dist/react-photo-view.css';

function App() {
  return (
    <PhotoProvider>
      <PhotoView src="https://github.com/MinJieLiu/react-photo-view/raw/master/1.jpg">
        <img src="https://github.com/MinJieLiu/react-photo-view/raw/master/1-thumbnail.jpg" alt="" />
      </PhotoView>
    </PhotoProvider>
  );
}

License

Apache-2.0 © MinJieLiu