Scan your whole stack
Are you using @opendrawjs/react?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.1
@opendrawjs/react was last scanned on 29 Nov 2026 at version 0.1.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.1 LATEST | 29 Nov 2026 | No rules fired |
Findings for v0.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
@opendrawjs/react renders the opendraw editor in React: the hand-drawn canvas with every gesture and keyboard shortcut, a toolbar, zoom and history controls, a theme toggle and autosave. It is a thin layer over the framework-free @opendrawjs/editor, so the drawing behavior is identical to the Vue and Svelte versions.
npm install @opendrawjs/react
# or: pnpm add @opendrawjs/react · yarn add @opendrawjs/react · bun add @opendrawjs/react
Requires React 18.2 or newer (React 19 works too).
Import the styles once, then render <OpenDraw> in a container with a height:
import '@opendrawjs/react/styles.css'
import { OpenDraw } from '@opendrawjs/react'
export function Board() {
return (
<div style={{ height: '100vh' }}>
<OpenDraw />
</div>
)
}
That's a working whiteboard that saves to localStorage as you draw.
Next.js: the editor needs the browser, so render it in a client component (
'use client'), or load it withdynamic(() => import('./Board'), { ssr: false }).
<OpenDraw>import type { OpenDrawState } from '@opendrawjs/react'
function save(state: OpenDrawState) {
// send state.elements to your API, or anywhere else
}
<OpenDraw theme="dark" persist="team-board" onChange={save} />
| Prop | Type | Default | |
|---|---|---|---|
theme |
'light' \| 'dark' \| 'system' |
'system' |
Starting theme. A theme the user picked (and saved) wins over it. |
persist |
boolean \| string |
true |
Autosave to localStorage. A string is the storage key; false turns it off. |
initialElements |
OpenDrawElement[] |
[] |
The scene to start with when nothing is saved. |
ui |
'full' \| 'none' |
'full' |
full: toolbar, zoom, history and theme · none: the bare canvas. |
onChange |
(state: OpenDrawState) => void |
Every document or editor-state change. | |
editor |
EditorController |
Bring your own controller to drive the editor from outside. | |
children |
ReactNode |
Your own overlay content, rendered inside the editor. | |
className · style |
On the editor's root element. |
Create the controller yourself with useOpenDrawEditor(), pass it in, and read any state with useEditorState(). Every command is undoable.
import '@opendrawjs/react/styles.css'
import { OpenDraw, useEditorState, useOpenDrawEditor } from '@opendrawjs/react'
export function Board() {
const editor = useOpenDrawEditor()
const selected = useEditorState(editor, (e) => e.selectedElements.length)
const canUndo = useEditorState(editor, (e) => e.canUndo)
return (
<div style={{ height: '100vh' }}>
<OpenDraw editor={editor}>
<div className="my-actions">
<button disabled={selected === 0} onClick={() => editor.changeStyle({ strokeColor: '#e03131' })}>
Make it red
</button>
<button disabled={!canUndo} onClick={() => editor.undo()}>Undo</button>
<button onClick={() => editor.exportPNG('diagram')}>Export PNG</button>
</div>
</OpenDraw>
</div>
)
}
useEditorState(editor, read) re-renders only when what read returns changes. Return values the editor already holds (like e.selectedElements or e.activeTool), not new arrays or objects made in read.
Render only the canvas with <OpenDrawCanvas> and build the chrome yourself. The canvas keeps every gesture, shortcut and the text editor; add useScenePersistence() for autosave.
import '@opendrawjs/react/styles.css'
import { OpenDrawCanvas, useEditorState, useOpenDrawEditor, useScenePersistence } from '@opendrawjs/react'
export function Board() {
const editor = useOpenDrawEditor()
useScenePersistence(editor, { persist: 'my-board' })
const tool = useEditorState(editor, (e) => e.activeTool)
return (
<div className="opendraw" data-opendraw-root style={{ height: '100vh' }}>
<OpenDrawCanvas editor={editor} />
<nav className="my-toolbar">
<button aria-pressed={tool === 'rectangle'} onClick={() => editor.setActiveTool('rectangle')}>Rectangle</button>
<button aria-pressed={tool === 'arrow'} onClick={() => editor.setActiveTool('arrow')}>Arrow</button>
</nav>
</div>
)
}
The editor controller (EditorController) exposes the whole API: state getters such as elements, selectedElements, activeTool, theme, viewport, canUndo; and commands such as setActiveTool, changeStyle, changeArrowType, groupSelection, alignSelection, undo, zoomToFitAll, serialize, loadFile, exportPNG, exportSVG and saveToFile. See @opendrawjs/editor.
| Export | |
|---|---|
OpenDraw |
The full editor. |
OpenDrawCanvas |
The canvas alone, for your own UI. |
Toolbar · Footer · ArrowTypePicker |
The built-in pieces, to compose your own layout. |
useOpenDrawEditor(options?) |
Create a controller for this component's lifetime. |
useEditorState(editor, read) |
Subscribe to a slice of editor state. |
useScenePersistence(editor, { persist, theme }) |
Autosave and restore. |
createEditor · EditorController |
Re-exported from @opendrawjs/editor. |
OpenDrawState · OpenDrawElement · OpenDrawAppState · OpenDrawFile |
Scene types, re-exported from @opendrawjs/core. |
@opendrawjs/react/styles.css |
The editor styles. |
The chrome is styled with CSS custom properties on .opendraw. Override them from a wrapper:
.my-board .opendraw {
--od-accent: #2563eb;
--od-brand-active: #1d4ed8;
--od-accent-soft: #dbeafe;
--od-on-accent-soft: #1e3a8a;
--od-hover: #eff6ff;
}
.my-board .opendraw[data-theme='dark'] {
--od-accent: #60a5fa;
--od-brand-active: #93c5fd;
--od-accent-soft: #1e3a8a;
--od-on-accent-soft: #dbeafe;
--od-hover: #1e2a44;
}
| V / 1 Select | R / 2 Rectangle | D / 3 Diamond | O / 4 Ellipse |
| A / 5 Arrow | L / 6 Line | P / 7 Draw | T / 8 Text |
| N Sticky note | 9 Image | E / 0 Eraser | F Frame · K Laser |
| ⌘ Z Undo | ⌘ G Group | ⌘ D Duplicate | ⌘ A Select all |
On Windows and Linux, Ctrl replaces ⌘.
| Package | |
|---|---|
@opendrawjs/nuxt |
Nuxt and Vue, with the full editor UI (properties panel, menus, many drawings). |
@opendrawjs/svelte |
The same editor for Svelte 5. |
@opendrawjs/editor |
The framework-free editor. |
@opendrawjs/core |
The engine: element model, history, rendering and export. |
opendraw is an independent project, built with gratitude to Excalidraw, whose design and code it learns from (some parts are ported under Excalidraw's MIT license). It is not affiliated with Excalidraw.
MIT © 2026 Vishnu
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.