# react-realtime-drawing

> Realtime canvas drawing hooks for React

Latest version **0.2.0** (published 2026-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-realtime-drawing
pnpm add react-realtime-drawing
yarn add react-realtime-drawing
bun add react-realtime-drawing
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-03-08 |
| First published | 2020-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 52.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | jsaari97 |
| Maintainers | jsaari |
| Keywords | react, realtime, canvas, drawing, hooks |

## Links

- npm: https://www.npmjs.com/package/react-realtime-drawing
- Repository: https://github.com/jsaari97/react-realtime-drawing
- Homepage: https://jsaari97.github.io/react-realtime-drawing
- Issues: https://github.com/jsaari97/react-realtime-drawing/issues
- npm.io page: https://npm.io/package/react-realtime-drawing

## 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

- 0.2.0 (latest) — 2026-03-08
- 0.1.4 — 2022-02-13
- 0.1.3 — 2020-12-18
- 0.1.2 — 2020-10-26
- 0.1.1 — 2020-08-04
- 0.1.0 — 2020-06-19

## README

# React Realtime Drawing

React hooks for HTML canvas drawing and spectation in real time.

## Features

- React hooks support :sparkles:
- Mouse and touch support :computer_mouse::point_up_2:
- Brush color and size support :paintbrush:
- Automatic canvas scaling :arrow_up_down:
- Lightweight, under 2kB gzipped :rocket:
- Dependency-free! :package:
- Built with TypeScript, typings included :computer:

## Usage

```jsx
import React from 'react';
import { useRealtimeDrawer, useRealtimeViewer } from 'react-realtime-drawing';

export default () => {
  const [viewerRef, { onChange }] = useRealtimeViewer();

  const [drawerRef] = useRealtimeDrawer({
    color: '#00ffaa',
    onChange
  });

  return (
    <div>
      <div style={{ width: 512, height: 512 }}>
        <canvas ref={drawerRef} />
      </div>
      <div style={{ width: 512, height: 512 }}>
        <canvas ref={viewerRef} />
      </div>
    </div>
  );
}
```

## Installation

```bash
$ npm install react-realtime-drawing
```

## License

MIT © [Jim Saari](https://github.com/jsaari97)

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