Main canvas component with drawing, selection, and collaboration
WhiteboardToolbar
Drawing tools, color picker, stroke width, undo/redo
ZoomToolbar
Zoom in, zoom out, reset, and fit-to-screen controls
ObjectActionMenu
Context menu for selected objects (delete, duplicate, etc.)
SelectionShortcutMenu
Floating shortcut menu shown next to a current selection
LaserPointer
Laser pointer visualization for presentations
Hooks
Hook
Description
useWhiteboardCanvas(options)
Canvas initialization, zoom, pan, and object management
useWhiteboardTools(options)
Tool selection, drawing mode, color, and stroke width
useWhiteboardSync(options)
Real-time synchronization of canvas changes across users
useLaserPointer(options)
Laser pointer broadcast and remote pointer rendering
useWhiteboardFile(options)
File save, load, auto-save, and sharing operations. saveFile() resolves with the persisted WhiteboardFile (or undefined when nothing was saved); concurrent calls are serialised. Auto-save backs off while saves keep failing and pauses after a credential failure (autosaveSuspended) until the next edit
Dialogs
Component
Description
UnsavedChangesDialog
Prompts to save, discard, or cancel before closing
FileSharingDialog
Share a whiteboard file with selected participants
CreateWhiteboardDialog
Create a new whiteboard with a name and optional sharing
Add-in System
Extend the whiteboard with custom tools using the add-in API. Add-ins can contribute toolbar buttons, context menu items, and custom object types.
Export
Description
WhiteboardAddin
Base class for creating custom add-ins
WhiteboardAddinRegistry
Registry for managing add-in lifecycle
StickyNotesAddin
Built-in add-in for colorful sticky notes
WhiteboardAddinInterface
Type alias matching the WhiteboardAddin class shape
WhiteboardAddinRegistryInterface
Type alias matching the WhiteboardAddinRegistry class shape
// Enable specific add-ins registry.enable('sticky-notes'); registry.enable('stamps');
// Get toolbar buttons from all enabled add-ins constbuttons = registry.getToolbarButtons();
// Listen for lifecycle events registry.addEventListener('addin-enabled', ({ addinId }) => { console.log(`${addinId} was enabled`); });
Props
Whiteboard
Prop
Type
Description
width
number
Canvas width
height
number
Canvas height
readOnly
boolean
Disable editing
showGrid
boolean
Show background grid
fileId
string
File ID for persistence
enableAddins
boolean
Enable the add-in system
enabledAddins
string[]
IDs of add-ins to enable
labels
Partial<WhiteboardLabels>
Custom labels
icons
Partial<WhiteboardIcons>
Custom icons
colors
Partial<WhiteboardColors>
Custom colors
styles
Partial<WhiteboardStyles>
Custom styles
renderProps
WhiteboardRenderProps
Custom renderers
onError
(error: Error) => void
Error callback
WhiteboardToolbar
Prop
Type
Description
orientation
'horizontal' | 'vertical'
Toolbar orientation
tools
ToolbarButton[]
Available tools
showColorPicker
boolean
Show color picker
showStrokeWidth
boolean
Show stroke width selector
labels
Partial<WhiteboardLabels>
Custom labels
icons
Partial<WhiteboardIcons>
Custom icons
colors
Partial<WhiteboardColors>
Custom colors
ZoomToolbar
Prop
Type
Description
labels
Partial<WhiteboardLabels>
Custom labels
icons
Partial<WhiteboardIcons>
Custom icons
SelectionShortcutMenu accepts SelectionShortcutMenuProps for wiring up actions on the currently selected object(s).
Background rasters
Background pages (images and rendered PDF pages) are embedded in the whiteboard file as data URLs. They are capped to 2500 px on the long side and 5000 px tall and encoded as WebP (JPEG where the browser cannot encode WebP). Each page also carries a small thumbDataUrl used by the page drawer. Files saved by earlier versions with large PNG pages load unchanged and are re-encoded in the background; the smaller raster is persisted on the next save.
Features
Real-time collaboration across all connected users
Drawing tools: pencil, shapes (rectangle, circle, triangle), text
Shape fill modes: filled or outlined
Zoom and pan with mouse wheel and touch gestures
Undo/redo with full history
Laser pointer for presentations (multiple colors per user)
File persistence with auto-save
Owner presence detection (read-only when owner leaves)
Extensible add-in system for custom tools and objects
Keyboard shortcuts for common operations
Keyboard Shortcuts
Shortcut
Action
Ctrl+Z / Cmd+Z
Undo
Ctrl+Y / Cmd+Y
Redo
Delete / Backspace
Delete selected objects
Escape
Deselect all
Utility Functions
Coordinate, serialization, and file utilities are exported for advanced use cases.
Render a saved whiteboard file to a small preview image. whiteboardThumbnailGenerator plugs directly into a file manager's thumbnailGenerators prop so card views show the actual drawing:
loadingBackground is shown over the canvas while a background page is being rendered (on open, on page turn, during a PDF import or a peer rebuild); loading covers the file content itself.
Example