File tree Expand file tree Collapse file tree 4 files changed +58
-4
lines changed Expand file tree Collapse file tree 4 files changed +58
-4
lines changed Original file line number Diff line number Diff line change 1
1
# React Signature Pad
2
2
A [ signature pad] ( https://github.com/szimek/signature_pad ) implementation for react.
3
3
4
- # Usage
4
+ # Basic Usage
5
5
6
6
``` javascript
7
7
var React = require (' react' );
@@ -13,6 +13,42 @@ React.render(
13
13
)
14
14
```
15
15
16
+ # Methods
17
+
18
+ ``` javascript
19
+ < SignaturePad clearButton= " true" ref= " mySignature" / >
20
+ ...
21
+
22
+ var signature = React .findDOMNode (this .refs .mySignature );
23
+
24
+ // Methods
25
+
26
+ // ===============================================
27
+ // isEmpty() - returns boolean
28
+ // ===============================================
29
+
30
+ signature .isEmpty ();
31
+
32
+ // ===============================================
33
+ // clear() - clears canvas
34
+ // ===============================================
35
+
36
+ signature .clear ();
37
+
38
+ // ===============================================
39
+ // toDataURL() - retrieves image as a data url
40
+ // ===============================================
41
+
42
+ signature .toDataURL ();
43
+
44
+ // ===============================================
45
+ // fromDataURL() - writes a base64 image to canvas
46
+ // ===============================================
47
+
48
+ signature .fromDataURL (base64String);
49
+
50
+ ```
51
+
16
52
# CSS
17
53
In order to make the signature pad work correctly you will need the css as well. All the relevant styles are in [ this file] ( style.css ) .
18
54
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-signature-pad" ,
3
- "version" : " 0.0.1 " ,
3
+ "version" : " 0.0.2 " ,
4
4
"description" : " A signature pad implementation for react." ,
5
5
"main" : " lib/app.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments