This repository has been archived by the owner on Apr 30, 2021. It is now read-only.
V1 First Prerelease
Pre-release
Pre-release
The new API comes with a breaking change. It's not intended, but it's for the best.
Installation
npm install react-rough@next
Usage
For now ReactRough takes render
prop and gives you the rough canvas instance, so you could do whatever you wish with it.
This API will not likely change so it's safe to use. I'd just add Rough Components (Circle, Arc, e.t.c), work on docs and make a full release.
import ReactRough from 'react-rough'
render(<ReactRough
width="500"
height="200"
render={rc => {
rc.circle(80, 120, 50) // centerX, centerY, diameter
rc.ellipse(300, 100, 150, 80) // centerX, centerY, width, height
rc.line(80, 120, 300, 100) // x1, y1, x2, y2
}}
/>)