Episode Summary
Executive Summary: Steve Ruiz discusses how TL Draw evolved from experiments in digital ink, SVG/React canvases, and state machines into a smooth, open-source, multiplayer drawing platform. The conversation covers why TL Draw avoids HTML canvas, how Perfect Freehand simulates pressure-sensitive ink, how state management and zoom/pan work, and how the project is becoming a developer platform for building custom collaborative canvas apps.
Main Topics: Origins of TL Draw: Ruiz explains how TL Draw emerged from years of prototyping digital ink, building Globs, and integrating the work into Excalidraw before creating his own canvas tool. Why DOM/SVG over HTML Canvas: He argues that using regular DOM and SVG makes embedded components, text, and UI interactions far easier than HTML Canvas, while still being performant enough for many drawing apps. Perfect Freehand and digital ink: The episode dives into Ruiz’s open-source pressure-sensitive line algorithm, including pressure simulation, smoothing, and edge-case handling for natural-looking strokes. State machines and interaction design: Ruiz describes the session/state-chart approach used to manage complex user interactions like dragging, selecting, rotating, and canceling actions in a predictable way. Zooming, panning, and rendering model: The hosts explore how TL Draw handles camera controls with CSS transforms and why this approach keeps the canvas performant and flexible. Persistence, multiplayer, and offline support: The discussion covers IndexedDB persistence, file-based .tldr documents, VS Code integration, and Liveblocks-powered collaboration. TL Draw as a platform and startup: Ruiz explains the shift from the app itself to TL Draw as developer infrastructure for building specialized canvas-based products like annotations, project tools, and whiteboards.
Key Arguments: A drawing app can be built effectively with React, SVG, and standard DOM elements instead of relying on HTML Canvas. The browser already provides many rendering optimizations for free, so DOM-based approaches can be surprisingly fast for many use cases. A pressure-sensitive stroke algorithm must look stable while drawing, not only after the user finishes the stroke, to feel like real ink. State machines reduce complexity by limiting which events matter in any given interaction state, avoiding sprawling if/else logic. Using pointer events enables broad input support across mouse, touch, and pen devices, with pressure handling where available. Local-first storage with IndexedDB and file-based .tldr documents makes TL Draw practical for offline use and version control. TL Draw’s future is as a configurable canvas infrastructure layer, not just a standalone app.
Data Points: Full-time development start: July 2021 - Ruiz said he began working on TL Draw full time in July 2021. Public release: November 2021 - He released TL Draw a few months after going full time. Locale temperature: 35°C / 95°F - Ruiz mentioned Hamilton, Canada experiencing 35°C weather. Weather example: 100°F - The hosts referenced Denver being around 100 degrees. Pressure fallback: 0.5 - Ruiz noted that pointer devices that don’t report pressure should generally fall back to a 0.5 pressure value. Storage limit reference: About 15 MB - He cited localStorage as having a small storage ceiling compared with IndexedDB. Codebase format: JSON blob - TL Draw documents can be saved as a file containing a large JSON structure. Platform support: PWA - He said TL Draw is installable as a progressive web app on desktop and mobile.
Pivotal Quotes: "I spent like six months on this like problem for SVG, for anything really. How do you make a variable-width line, this like sort of digital ink." — Steve Ruiz: Describing the origin of Perfect Freehand and his digital-ink research "The browser's pretty sweet. I didn't even know how much we got for free until I started on this project." — Steve Ruiz: Explaining why DOM/SVG rendering was more viable than expected "Once I'm in that state, I know that only a couple of things matter... and so you can write pretty tight code for just that part of the state rather than having an incredible pile of if-else statements." — Steve Ruiz: Justifying the use of state machines for interaction handling
Implications: Listeners should see that advanced canvas-like apps can be built with web-native primitives, strong interaction design, and local-first storage. For teams, TL Draw signals a growing market for customizable canvas infrastructure.
About Syntax - Tasty Web Development Treats
View all episodes from Syntax - Tasty Web Development Treats