Back to Tldraw

Replace a built-in overlay

apps/examples/src/examples/editor-api/replace-brush-overlay/README.md

5.0.2391 B
Original Source

Swap out a built-in overlay for a custom implementation.


Every canvas overlay — the selection brush, scribble, snap indicators, shape handles — is an OverlayUtil subclass you can replace. This example extends the built-in BrushOverlayUtil and overrides its render method to draw a dashed purple rectangle in place of the default gray one. Drag-select on the canvas to see it.