Skip to content

Commit

Permalink
Adding documentation around public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
blackjk3 committed Aug 5, 2015
1 parent 9a2991e commit 1ddef44
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# React Signature Pad
A [signature pad](https://github.com/szimek/signature_pad) implementation for react.

# Usage
# Basic Usage

```javascript
var React = require('react');
Expand All @@ -13,6 +13,42 @@ React.render(
)
```

# Methods

```javascript
<SignaturePad clearButton="true" ref="mySignature" />
...

var signature = React.findDOMNode(this.refs.mySignature);

// Methods

// ===============================================
// isEmpty() - returns boolean
// ===============================================

signature.isEmpty();

// ===============================================
// clear() - clears canvas
// ===============================================

signature.clear();

// ===============================================
// toDataURL() - retrieves image as a data url
// ===============================================

signature.toDataURL();

// ===============================================
// fromDataURL() - writes a base64 image to canvas
// ===============================================

signature.fromDataURL(base64String);

```

# CSS
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).

Expand Down
2 changes: 1 addition & 1 deletion lib/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-signature-pad",
"version": "0.0.1",
"version": "0.0.2",
"description": "A signature pad implementation for react.",
"main": "lib/app.js",
"scripts": {
Expand Down
Loading

0 comments on commit 1ddef44

Please sign in to comment.