lesca-react-capture-button
TypeScript icon, indicating that this package has built-in type declarations

2.1.4 • Public • Published

NPM React React React React React NPM

Why use it?

get base64 image use local file or mobile camera.

Installation

npm install lesca-react-capture-button --save

Usage

import CaptureProvider, { DOMString } from 'lesca-react-capture-button';

render() {
    return (
        <CaptureProvider
          type={DOMString.png}
          compress={0.5}
          maxWidth={500}
          onCapture={(data) => {
            const { image } = data;
            console.log(image);
          }}
        >
          <button>capture</button>
        </CaptureProvider>
    );
}

Development

props

Properties description default
onCapture:function callback void
compress:float image compress (0 - 1) 0.7
maxWidth:int image max width size 1024
type:string type 'image/png'

Features

  • maintain if necessary

Readme

Keywords

Package Sidebar

Install

npm i lesca-react-capture-button

Weekly Downloads

3

Version

2.1.4

License

MIT

Unpacked Size

561 kB

Total Files

42

Last publish

Collaborators

  • jameshsu1125