Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
README for beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ooade committed Feb 14, 2019
1 parent 1ea3fc2 commit 91d5686
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,24 @@

```sh
- npm add react-rough
- npm add roughjs@2.0.0
- npm add roughjs
```

`Note: The documentation is for the beta release. For the stable release check out the master branch`

### Render a Rectangle

```js
import ReactRough from 'react-rough';

const options = {
points: [10, 10, 200, 200], // x, y, width, height
fill: 'red',
fillWeight: 3
};
import ReactRough, { Rectangle } from 'react-rough';

render(
<ReactRough width={220} height={220}>
<Rectangle options={options} />
<Rectangle points={[10, 10, 200, 200]} fill="red" fillWeight={3} />
</ReactRough>
);
```

`Note: A Static Method must be nested within a ReactRough Component, it could have other surrounding elements, but it's GrandParent must be a Rough Component`
`Note: All shapes must be nested within a ReactRough Component, it could have other surrounding elements, but it's GrandParent must be a ReactRough Component`

When you grab a shape from ReactRough, it renders each shape to a canvas element. So how can we render different shapes on a single canvas element? We'll answer that below.

Expand Down

0 comments on commit 91d5686

Please sign in to comment.