You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# react-signature-pad-wrapper
2
-
A React wrapper for [signature pad](https://github.com/szimek/signature_pad).
2
+
A React wrapper for [signature pad](https://github.com/szimek/signature_pad).
3
3
4
4
There are some other React packages that are based off the original *signature_pad* plugin (e.g. [react-signature-pad](https://github.com/blackjk3/react-signature-pad), [react-signature-canvas](https://github.com/agilgur5/react-signature-canvas)). This package is different in the sense that it relies on *signature_pad* as a dependency rather than an implementation that is based off of it (like the aforementioned packages).
5
5
@@ -8,9 +8,13 @@ This package is available through npm:
8
8
```
9
9
npm install --save react-signature-pad-wrapper
10
10
```
11
+
In addition to *React* you will need to install the [prop-types](https://github.com/facebook/prop-types) package:
12
+
```
13
+
npm install --save prop-types
14
+
```
11
15
12
16
## Usage
13
-
This package implements exactly the same interface as the original *signature_pad* and adds a couple of extra features that make responsive behaviour a little easier to deal with. For a complete overview of the available options and callables see the documentation for [signature pad](https://github.com/szimek/signature_pad).
17
+
This package implements exactly the same interface as the original *signature_pad*package and adds a couple of extra features that make responsive behaviour a little easier to deal with. For a complete overview of the available options and callables see the documentation for [signature pad](https://github.com/szimek/signature_pad).
14
18
15
19
Import the component like (ES6):
16
20
```javascript
@@ -64,7 +68,7 @@ render() {
64
68
}
65
69
...
66
70
```
67
-
The canvas width and height will now be updated whenever the window is resized (using a debounced handler). Changing the width and height properties of a HTML canvas object will erase its current content.
71
+
The canvas width and height will now be updated whenever the window is resized (using a debounced handler). Changing the width and height properties of a HTML canvas object will erase its current content.
68
72
69
73
If you'd like to keep what is currently drawn on the canvas you can pass a `redrawOnResize` property to the component and set it to `true` (`redrawOnResize` is `false` by default):
70
74
```javascript
@@ -81,4 +85,4 @@ This project includes a simple example that demonstrates a responsive sketch pad
81
85
```
82
86
npm run build:example
83
87
```
84
-
Then open `example/index.html` in a browser of yout choice.
88
+
Then open `example/index.html` in a browser of your choice.
0 commit comments