Examples
Collaborative Canvas
A real-time multiplayer canvas with live cursors and a presence bar.
The apps/demo-canvas app in the monorepo is a full collaborative canvas demo. View on GitHub.
It demonstrates:
- Live cursor rendering on an HTML5 canvas element
- A presence bar showing who is in the room
- Join/leave toast notifications
- Connection status indicator
- Shareable room URLs via
?room=query parameter - Smooth cursor interpolation
Key patterns
Track mouse relative to a canvas element
Canvas-relative normalization instead of viewport-relative:
Render remote cursors as an HTML overlay
Position absolute over the canvas using percentage coordinates:
Shareable room link
Read the room from the URL and write it back with replaceState: