1.0.9 • Published 5 years ago

paste-img v1.0.9

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

React Component

Live Demo

A simple example that works in all major browsers.

How use

npm install paste-img
import React, { Fragment, Component } from 'react';
import { PasteImage } from 'paste-img';

class Home extends Component {
  onChange = (base64) => {
    console.log(base64);
  };
  render() {
    return (
      <Fragment>
        <PasteImage onChang={this.onChange} />
      </Fragment>
    );
  }
}

Provide tools

import { getBase64 } from 'paste-img';
getBase64('https://something.com').then(base => {
  console.log(base)
})

API

ArgumentsDescriptionTypeDefault
defaultBase64defaultBase64string-
base64base64string-
stylestyleobject-
classNameclassNamestring-
onChangfunction(base64){ }function-
tiptips when pasted content is not a picturestring

Development

clone locally:

$ git clone https://github.com/acuariol/paste-img.git
$ cd paste-img
$ npm install
$ npm start

Open your browser and visit http://localhost:8080 ,

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago