1.0.5 • Published 5 years ago

react-image-overlay v1.0.5

Weekly downloads
36
License
MIT
Repository
github
Last release
5 years ago

Warning, WIP.

Please do not use this package in production, yet. Breaking changes are on its way.

react-image-overlay

Overlay images with watermarks or additional layer with transparency (i.e. .png). Image orientation on iOS devices is auto-corrected.

NPM JavaScript Style Guide

Install

With npm:

npm install --save react-image-overlay

With yarn:

yarn add react-image-overlay

To do

  • styling props for image and overlay

Usage

import React, { Component } from 'react'
import Overlay from 'react-image-overlay'

class Foo extends Component {
  render () {
    return (
      <Overlay 
          url='https://placeimg.com/250/250/any' // required
          overlayUrl='https://placeimg.com/50/50/any' // required
          imageHeight={100}
          position={'bottomRight'}
          overlayWidth={50}
          overlayHeight={50}
          overlayPadding={10}
          watermark={false}
      />
    );
  }
};

Prop-types

proptype
urlstringrequired
overlayUrlstringrequired
imageHeightnumberoptional
imageWidthnumberoptional
overlayHeightnumberoptional
overlayWidthnumberoptional
positionnumberpossible values: 'bottomLeft', 'center', 'bottomRight', 'topLeft', 'topRight'
overlayPaddingnumberthe amount of padding for the overlay, calculated from the edge of the main image
watermarktrue/falseuse this option if you want the overlay to be applied as a watermark

Important Note: Enabling watermark renders the image and overlay to a single canvas, preventing site users from downloading images separately.

License

MIT © saintograph

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago