An open API service indexing awesome lists of open source software.

https://github.com/satyam-2001/react-arts

It is a library of react functional component which provides canvas sketch board in the application.
https://github.com/satyam-2001/react-arts

art canvas drawingboard npm package react sketch

Last synced: about 2 months ago
JSON representation

It is a library of react functional component which provides canvas sketch board in the application.

Awesome Lists containing this project

README

        

# 🎨 React Arts

`React Arts` is a library of react functional component which provides `canvas sketch board` in the app.

This library contains two react component `CanvasSketch` and `CanvasSketchTool`



LIVE DEMO


react_arts

# Installation

This module is installed via npm:

```shell
npm install react-arts
```

# CanvasSketch

`CanvasSketch` component appends simple canvas where a user can sketch using mouse or touch behaviour on screen.

```javascript
import './App.css';
import { CanvasSketch } from 'react-arts';

function App() {

const [clearCanvas, setClearCanvas] = useState()

return (



Clear Frame

);
}

export default App;
```

## API

| Name | Type | Required | Default | Description |
| -------------- | -------------- | -------- | ------- | ------------------------------------------- |
| height | Number | true | - | Height of canvas
| width | Number | true | - | Width of canvas
| color | String | false | black | Color for sketch
| lineWidth | Number | false | 4 | Width of the pen
| lineCap | String | false | round | Shape of pen for sketch
| option | String | false | pen | Option for sketch [pen / paint]
| getClearCanvas | Function | false | - | Returs clearCanvas function to setState


# CanvasSketchTool

`CanvasSketchTool` component is advance version of CanvasSketch which also comes with a tool kit to change and use properties like `color`, `erase`, `line width`, `clear canvas`, `floodfill`.

```javascript
import './App.css';
import { CanvasSketchTool } from 'react-arts';

function App() {

return (




);
}

export default App;
```

## API

| Name | Type | Required | Default | Description |
| -------------- | -------------- | -------- | ------- | ----------------- |
| height | Number | true | - | Height of canvas
| width | Number | true | - | Width of canvas


# Author

Satyam Lohiya