signature-component
v1.0.1
Published
````bash npm i signature-component ```` ````bash yarn add signature-component ```` # Using ````js import { useActions, Signature } from 'signature-component';
Downloads
6
Maintainers
Readme
Install
npm i signature-component
yarn add signature-component
Using
import { useActions, Signature } from 'signature-component';
const { clearSignature, getImageSignature, isEmpty, changeBackgroundColor } = useActions()
const imageIsEmpty = () => {
!isEmpty() ? console.log(getImageSignature()) : console.log("not image!")
}
return (
<div>
<div>
<button onClick={() => clearSignature()}>
Clear
</button>
<button onClick={imageIsEmpty}>
Get image
</button>
<button onClick={() => changeBackgroundColor("#87CEEB")}>
Background
</button>
</div>
<Signature
penColor="#000000"
width={500}
height={500}
/>
</div>
)