Introduction

What Draw is, what it can do, and where it stands.

svelte-draw is an infinite canvas for Svelte: the engine of a whiteboard, and the parts to put one on a page. You draw, write, drag out shapes, connect them with arrows that stay attached, add pictures and links, group and frame things, turn and snap them, copy and paste, undo, on as many pages as you like. A board can be kept in the browser and stays in step across tabs; it saves to a file and to a picture.

Shapes and tools are plugins, also the ones that come with it. So the same engine can be a whiteboard today and a design tool later, and a kind of shape your app needs is a class and a Svelte component, not a fork.

What it is made of

Two layers, imported separately:

ImportWhat it is
@simon-lund/svelte-drawthe engine: plain TypeScript with no UI framework, so it runs in a browser, in a test and on a server alike
@simon-lund/svelte-draw/sveltethe Svelte layer: the canvas, the views of the built-in shapes, the minimap

How it is built explains the engine in five ideas.

Where it stands

  • Tested where it counts, not everywhere. The engine has its own tests, which need no browser, and the Svelte layer is tested in Chrome. Some parts have only been tried in a browser, and a few never ran at all. What is built says which is which, line by line.
  • Built with AI. The code, the tests and these pages are written by AI coding agents (Claude Code), directed by the project’s maintainers.
  • No controls of its own. The library is the engine and the canvas, in plain CSS, with three small dependencies. The toolbar, the panels and the menus are your app’s: build them on the editor, or copy the ones in the whiteboard example. Getting started shows both.
  • No server sync yet. Tabs of one browser stay in step today. The seam for a server is two small interfaces, and nothing on the server side is written.

Credits

Draw’s architecture is inspired by tldraw: records in a reactive store, one class per kind of shape, tools as state machines. Draw is an independent project, written from scratch for Svelte; it contains no tldraw code and is not affiliated with tldraw Inc.

Ink strokes are drawn with perfect-freehand, the stacking order comes from fractional-indexing, and the icons are Phosphor.

Licence

MIT. Use it, change it, ship it; keep the copyright notice.