Skip to content

Commit 1ddef44

Browse files
committed
Adding documentation around public methods
1 parent 9a2991e commit 1ddef44

File tree

4 files changed

+58
-4
lines changed

4 files changed

+58
-4
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# React Signature Pad
22
A [signature pad](https://github.com/szimek/signature_pad) implementation for react.
33

4-
# Usage
4+
# Basic Usage
55

66
```javascript
77
var React = require('react');
@@ -13,6 +13,42 @@ React.render(
1313
)
1414
```
1515

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+
1652
# CSS
1753
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).
1854

lib/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-signature-pad",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "A signature pad implementation for react.",
55
"main": "lib/app.js",
66
"scripts": {

0 commit comments

Comments
 (0)