react-canvas-paint

1.0.1 • Public • Published

react-canvas-paint

DEMO

A react drawing library


library example

NPM JavaScript Style Guide

Install

npm install --save react-canvas-paint

Usage

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

This module was bootstrapped with create-react-library.

Readme

Keywords

Package Sidebar

Install

npm i react-canvas-paint

Weekly Downloads

52

Version

1.0.1

License

MIT

Unpacked Size

33.9 kB

Total Files

8

Last publish

Collaborators

  • piotrrussw