Home

Awesome

react-raphael-scrawl

Version Downloads

so easy! create scrawl with react-raphael.

Install

# or specify the externals in webpack config
npm install --save raphael
# install react-raphael-scrawl in your react-raphael-scrawl project
npm install --save react-raphael-scrawl

Quickly Start

var React = require('react');
var ReactDOM = require('react-dom');
var Scrawl = require('react-raphael-scrawl');
	
class ScrawlApp extends React.Component {
    handleClick(){
        this.refs.scrawl.clear();
    }
    render(){
        return (<div>
        <div>
                <button onClick={this.handleClick.bind(this)}>清除画布</button>
        </div>        
        <Scrawl ref="scrawl" width={500} height={600} attr={{"stroke": "#000","stroke-width": 6}} />
        </div>)
    }
}

ReactDOM.render(<div>
                <ScrawlApp />
                </div>,document.getElementById("react-container"));

API

All Scrawl Props

All Scrawl Ref

Contact

Email: liuhong1.happy@163.com