# react-canvas-paint

> A react drawing library

Latest version **1.0.1** (published 2021-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-canvas-paint
pnpm add react-canvas-paint
yarn add react-canvas-paint
bun add react-canvas-paint
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-03-08 |
| First published | 2021-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 33.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | piotrrussw |
| Maintainers | piotrrussw |
| Keywords | canvas, react, library |

## Links

- npm: https://www.npmjs.com/package/react-canvas-paint
- Repository: https://github.com/piotrrussw/react-canvas-paint
- Homepage: https://github.com/piotrrussw/react-canvas-paint#readme
- Issues: https://github.com/piotrrussw/react-canvas-paint/issues
- npm.io page: https://npm.io/package/react-canvas-paint

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-03-08
- 1.0.0 — 2021-03-07

## README

# react-canvas-paint
#### [DEMO](https://piotrrussw.github.io/react-canvas-paint/)
> A react drawing library
<br/>

![library example](assets/gif.gif?raw=true "GIF")

[![NPM](https://img.shields.io/npm/v/react-canvas-paint.svg)](https://www.npmjs.com/package/react-canvas-paint) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-canvas-paint
```

## Usage

```jsx
import React, { Component } from 'react'

import ReactCanvasPaint from 'react-canvas-paint'
import 'react-canvas-paint/dist/index.css'

class Example extends Component {
  render() {
    return <ReactCanvasPaint />
  }
}
```

## Props

| Property      | Type     | Default                                                            | Description                                     |
| :------------ | :------- | :----------------------------------------------------------------- | :---------------------------------------------- |
| `width`       | number   | 400                                                                | canvas width                                    |
| `height`      | number   | 400                                                                | canvas height                                   |
| `viewOnly`    | bool     | false                                                              | Set to true disable drawing on canvas           |
| `data`        | Object   | undefined                                                          | Initial imageData that can be put on the canvas |
| `onDraw`      | function | undefined                                                          | Function with imageData on every line drawn     |
| `colors`      | Array    | ['#7030A2', '#000000', '#0170C1', '#FE0002', '#FFFF01', '#00AF52'] | array of choosable colors to draw               |
| `strokeWidth` | number   | 5                                                                  | width of drawing stroke                         |


## License

MIT © [piotrrussw](https://github.com/piotrrussw)

This module was bootstrapped with [create-react-library](https://github.com/transitive-bullshit/create-react-library).

---
_Source: https://npm.io/package/react-canvas-paint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
