Shape operations
Create, modify, and remove shapes programmatically with full validation and consistency. Perfect for content generators, import systems, and automated drawing tools.

Direct programmatic control over your canvas application during runtime.
Create, modify, and remove shapes programmatically with full validation and consistency. Perfect for content generators, import systems, and automated drawing tools.

Control user focus by programmatically managing selections and highlights. Guide users’ attention through complex documents and coordinate multi-step workflows.

Direct viewport positioning and zoom levels with smooth animations. Build guided tours, presentation modes, and focus systems that automatically highlight relevant content.

Group multiple operations into atomic changes with clean undo/redo boundaries.
Access live canvas state through reactive queries that update automatically.
Build analytics systems, collaboration features, and custom interaction patterns by hooking into editor events and state changes.
Runtime APIs handle content generation, guided tours, and automated drawing workflows.
Production ready starter kit to build a canvas application with multiplayer. Building something different? See all starter kits
Self-hosted tldraw with real-time multiplayer collaboration built with Cloudflare Durable Objects. Production-ready backend that handles WebSocket connections, automatic persistence, and asset management. The same architecture that powers hundreds of thousands of collaborative sessions on tldraw.com.

Our team spent years to get all the details right, so you don’t have to.
The system enables precise control of user attention through programmatic selection and focus management. It supports complex selection patterns, hierarchical focus within groups, and intelligent viewport coordination. Selection integrates smoothly with keyboard navigation, accessibility features, and collaborative cursor management.
The editor provides complete control over shape creation, modification, and deletion with the same validation and consistency guarantees as user interactions. Programmatic operations automatically respect shape relationships, maintain bindings, and trigger the correct side effects across the canvas. The API also provides type-safe methods for bulk actions, transaction management, and constraint validation.
The system offers advanced camera control with smooth animations, intelligent bounds handling, and seamless viewport transitions. It provides precise coordinate control, configurable easing functions, and automatic conflict resolution between programmatic and user-driven changes. All operations adapt to responsive design constraints and device-specific interaction patterns.
Large assets like images and videos are handled separately from real-time synchronization to maintain performance. Files are uploaded to cloud storage (R2) and cached on Cloudflare's edge network. In this way, loading is fast worldwide, and WebSocket connections stay focused on lightweight canvas interactions data.
ClickUp modernized its whiteboard for millions of users, replacing legacy infrastructure with the tldraw SDK.
Examples
Have a look at our examples on how to implement UI customization features.
Manipulate canvas contents with shape creation, selection, and camera control through the editor API.
Programmatically zoom the camera to specific areas with precise bounds control and animation options.
Use the editor API to programmatically create arrows and bindings between shapes.
From small sketches to sprawling systems, the canvas adapts to your needs.