All Projects → tbolis → React Sketch

tbolis / React Sketch

Licence: mit
Sketch Tool for React-based applications, backed up by FabricJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Sketch

Sketchpad
Sketchpad is fully customisable collaborative whiteboard plugin written in pure JavaScript.
Stars: ✭ 85 (-79.47%)
Mutual labels:  paint, drawing, draw
powerpaint
Kreative PowerPaint - Library and Application for Bitmap and Vector Image Editing
Stars: ✭ 27 (-93.48%)
Mutual labels:  drawing, paint, draw
Mopaint
🎨💪 Modern, modular paint and more! (pre-alpha, not much done yet)
Stars: ✭ 50 (-87.92%)
Mutual labels:  paint, drawing, draw
Sketch
Sketch have a lot of basic functions to develop a drawing app for iPhone. Anyone can easily create drawing iOS Application.
Stars: ✭ 229 (-44.69%)
Mutual labels:  paint, drawing, draw
Drawing
Drawing and fill color
Stars: ✭ 37 (-91.06%)
Mutual labels:  drawing, paint, draw
Drawingboard.js
A canvas based drawing app that you can integrate easily on your website.
Stars: ✭ 2,072 (+400.48%)
Mutual labels:  paint, drawing
LCPaintView
🖌 Paint view for iOS.
Stars: ✭ 20 (-95.17%)
Mutual labels:  drawing, paint
drawim
A simple drawing library in Nim, inspired by p5js
Stars: ✭ 66 (-84.06%)
Mutual labels:  drawing, draw
Playground
A playground for android developers
Stars: ✭ 41 (-90.1%)
Mutual labels:  drawing, paint
leaflet-paintpolygon
Leaflet plugin to create polygon with circle as paint
Stars: ✭ 38 (-90.82%)
Mutual labels:  paint, draw
canvas-paint
🎨 helper functions for drawing onto <canvas> elements
Stars: ✭ 18 (-95.65%)
Mutual labels:  paint, draw
Pixelorama
A free & open-source 2D sprite editor, made with the Godot Engine! Available on Windows, Linux, macOS and the Web!
Stars: ✭ 2,535 (+512.32%)
Mutual labels:  paint, draw
isometric
A lightweight JavaScript library, written in TypeScript to create isometric projections using SVGs
Stars: ✭ 53 (-87.2%)
Mutual labels:  drawing, draw
Pretty Painter
Graphics editor for Android.
Stars: ✭ 105 (-74.64%)
Mutual labels:  paint, drawing
grafx2
Mirror of GrafX2. Official repo is on gitlab.
Stars: ✭ 108 (-73.91%)
Mutual labels:  drawing, draw
gridder
A Grid based 2D Graphics library
Stars: ✭ 51 (-87.68%)
Mutual labels:  paint, draw
drawa-android
🎨 Drawing application for Android made easy
Stars: ✭ 16 (-96.14%)
Mutual labels:  drawing, draw
Touchable
Flutter library to add gestures and animations to each Shape you draw on your canvas in your CustomPainter
Stars: ✭ 82 (-80.19%)
Mutual labels:  paint, draw
Drawing
A drawing application for the GNOME desktop.
Stars: ✭ 386 (-6.76%)
Mutual labels:  paint, drawing
Flutter Canvas
About using of canvas in the flutter
Stars: ✭ 259 (-37.44%)
Mutual labels:  paint, draw

react-sketch

GitHub release NPM release NPM downloads Build status

A Sketch tool for React based applications, backed-up by FabricJS

idea-image Please note that this module is still in development! Feel free to send me enhancements and ideas :)

Installation

npm install react-sketch --save

or with yarn

yarn add react-sketch

Source installation

In order to build from source, read the relevant instructions first.

Tested with node versions 6,7,8.

Usage

Import the relevant SketchField component and use it, you can find more on the examples folder of the project

import {SketchField, Tools} from 'react-sketch';

class SketchFieldDemo extends React.Component {
     render() {
        return (
            <SketchField width='1024px' 
                         height='768px' 
                         tool={Tools.Pencil} 
                         lineColor='black'
                         lineWidth={3}/>
        )
     }
}

Configuration Options

Option Type Default Description
tool Enumeration (string) pencil The tool to use, can be select, pencil, circle, rectangle, pan
lineColor String black The color of the line
lineWidth Number 1 The width of the line
fillColor String transparent The fill color (hex format) of the shape when applicable (e.g. circle)
backgroundColor String transparent The the background color of the sketch in hex or rgba
undoSteps Number 15 number of undo/redo steps to maintain
imageFormat String png image format when calling toDataURL, can be png or jpeg
width Number No Value(null) Set/control the canvas width, if left empty the sketch will scale to parent element
height Number 512 Set/control the canvas height, if left empty the sketch will take a reasonable default height
value JSON Property to utilize and handle the sketch data as controlled component
defaultValue JSON Default initial data, to load. If value is set then value will be loaded instead
widthCorrection Number 2 Specify some width correction which will be applied on resize of canvas, this will help to correct some possible border on the canvas style
heightCorrection Number 0 Specify some height correction which will be applied on resize of canvas, this will help to correct some possible border on the canvas style

Available tools

Tool Description
Pencil Free drawing pencil
Line Gives you the ability to draw lines
Rectangle Create rectangles
Circle Create circles
Rectangle Create Rectangles
Select Disables drawing and gives you the ability to modify existing elements in the canvas
Pan Disables drawing and gives you the ability to move the complete canvas at will, useful to adjust the canvas when zooming in or out (thank you wmaillard)

Examples

The project includes a webpack server for running the examples, just run:

git clone https://github.com/tbolis/react-sketch.git
yarn install
npm start

and navigate to http://localhost:23000

You can as well check the live showcase here: http://tbolis.github.io/showcase/react-sketch/

Issues

See https://github.com/tbolis/react-sketch/issues

Changelog

See https://github.com/tbolis/react-sketch/blob/master/CHANGELOG.md

License

MIT, do remember to add a reference if you find it useful :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].