v4.1.0

This month's release introduces a new shader starter kit for WebGL integration, along with API additions for embed control, minimap filtering, and localStorage-backed atoms.

What's new

Shader starter kit (#6847)

A new template demonstrating WebGL shader integration with tldraw for dynamic, interactive backgrounds that respond to canvas interactions. Includes four complete examples:

  • Fluid simulation - Navier-Stokes dynamics
  • Rainbow - Animated gradients
  • Shadows - Raymarching and signed distance fields
  • Minimal - Bare-bones template for custom shaders

Features configurable parameters, localStorage persistence, and full TypeScript support.

API changes

  • Add embedOnPaste option to EmbedDefinition for opting out of automatic embed-on-paste behavior. (#6874)
  • Add hideInMinimap option to ShapeUtil for excluding shapes from the minimap. (#6327)
  • Add snapType?: 'point' | 'align' to TLHandle for finer control over handle snapping. The canSnap property is now deprecated. (#6883)
  • Expose Editor#getShapePageBounds and isRecordsDiffEmpty as public methods. (#6871)
  • Add localStorageAtom to @tldraw/state for atoms backed by localStorage with cross-tab syncing. (#6876)
  • Add inline style picker component variants. (#6920)

Improvements

  • Make bookmark titles clickable. (#6326)
  • Optimize mobile top bar rendering. (#6895)
  • Add numpad Enter support for entering edit mode. (#6830)
  • Consolidate preferences menu items. (#6802)

Bug fixes

  • Fix accessibility shortcut typo. (#6811)
  • Fix focus mode action missing. (#6812)
  • Fix arrow rendering edge case. (#6799)
  • Fix empty window opening on anchor click. (#6817)
  • Fix missing translation key. (#6826)
  • Fix shape index race condition. (#6884)
  • Fix zero geometry vertices edge case. (#6885)
  • Fix style panel button overflow. (#6920)

View release on GitHub


Patch releases

v4.1.1

  • Update the formatting of the npm create tldraw command in the CLI output.

View release on GitHub

v4.1.2

  • Move InFrontOfTheCanvas component back out of the .tl-canvas element. (#7021)

View release on GitHub

Prev
v4.0.0
Next
v4.2.0