Skip to content

Lightweight MS paint-esque drawing canvas component for React

License

Notifications You must be signed in to change notification settings

james-oldfield/react-paint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d4ebbc · Sep 17, 2016

History

4 Commits
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016
Sep 17, 2016

Repository files navigation

react-paint 🎨

what

A simple Microsoft Paint-esque canvas drawing tool in a component for ReactJS.

demo

Works with both touch and click for both desktop and devices. There's a couple small drawing components out there but this takes a different approach to the drawing to canvas, producing smoother lines / curves.

how

To use in a react project, first, install via npm:

npm i react-paint --save

import React from 'react';
import ReactPaint from 'react-paint';

const props = {
  style: {
    background: 'tomato',
    /* Arbitrary css styles */
  },
  brushCol: '#ffffff',
  lineWidth: 10,
  className: 'react-paint',
  height: 500,
  width: 500,
  onDraw: () => { console.log('i have drawn!'); },
};

const App = () => <ReactPaint {...props} />;

About

Lightweight MS paint-esque drawing canvas component for React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published