5 ms·
Hey, author here! Glad folks are enjoying this. A few notes: - I post a _lot_ about tldraw on Twitter. If you're curious about how this came together, or want
by steveruizok 5y ago
Hey, author here! Glad folks are enjoying this.
A few notes:
- I post a _lot_ about tldraw on Twitter. If you're curious about how this came together, or want to follow along as we ship new features, check out my timeline (https://twitter.com/steveruizok https://twitter.com/steveruizok).
- The whole tldraw project is MIT licensed and open source (https://github.com/tldraw https://github.com/tldraw). And it's still in development! If you'd like to contribute, join the Discord channel (https://discord.gg/SBBEVCA4PG https://discord.gg/SBBEVCA4PG) or drop by the repo (https://github.com/tldraw/tldraw https://github.com/tldraw/tldraw).
- The multiplayer is using a pre-release version of Liveblocks (https://liveblocks.io/)—and https://liveblocks.io/)—and honestly isn't using it in a very clever way—and so can have some desync issues. Consider this part of the app an early beta.
- We also ship a Visual Studio Code extension that lets you use tldraw inside of VS Code! (https://marketplace.visualstudio.com/items?itemName=tldraw-org.tldraw-vscode https://marketplace.visualstudio.com/items?itemName=tldraw-o...)
A little more about the project itself:
The tldraw project has a few different layers.
At the bottom, there is a renderer named @tldraw/core (https://github.com/tldraw/core https://github.com/tldraw/core) that is essentially a "put React components on a canvas UI" engine. You give it a data model along with a set of utilities to interpret that data model. Simple but very fast, very flexible, and packed with helpers for building these kinds of apps. It's already being used for some pretty ambitious projects apart from tldraw itself.
The main library, @tldraw/tldraw (https://github.com/tldraw/core https://github.com/tldraw/core), exports the whole tldraw "app" as a React component named <Tldraw/>. This component can be embedded in any React project. It can be controlled either by props or by its own API (ie `app.selectAll().duplicate()`).
The website is a very thin Next.js app that embeds the <Tldraw/> component.
There are also a few other libraries: @tldraw/vec for the vector math and @tldraw/intersect for intersections. If you like to work on these kinds of projects, definitely bookmark those libraries! They contain a lot of useful code.
As for its development, I've taken off a few months between jobs to work on this full time. Until now, the site has been accessible only to my Github sponsors, but it's now free and open to everyone. If If you'd like to support the project's continued development, you can sponsor me here: https://github.com/sponsors/steveruizok https://github.com/sponsors/steveruizok.
I'll answer questions here but if you want to contact me directly, my DMs are open @steveruizok.
- maxbaines 5y agoThanks for the project, only yesterday I used mspaint on a call as was quick and easy to hand tool. Bookmarked tldraw, then read your comment about the VSCode extension that's awesome and super useful.
- mkl 5y agoThis looks great! The stroke smoothing seems really aggressive though. It's hard to write as neatly as I can in other apps. How tied to React is this? Could it be used without it, or adapted to that?
- steveruizok 5y agoRight on, I'm hoping to put in some more options for the freehand drawing tool. That part of the app is using my other project, perfect-freehand (https://perfect-freehand-example.vercel.app/ https://perfect-freehand-example.vercel.app/), which supports a ton of options. It'd just be a matter of exposing those through the UI. At the moment it's pretty tied to React, however the "app" itself—the big state machine that responds to events—is independent. It would take some effort to make it work with other libraries but it could be done.
- jarnagin 5y agoLove this. One idea that I haven't seen implemented in other drawing tools: the default behavior after drawing a shape is to revert to the select tool. This is rational but it can also pull you out of flow if you're trying to diagram quickly. It'd be useful to extend the keyboard shortcuts to the select tool, so that when I highlight a region with select, I can press, e.g. 5, and have a circle automatically filled inside the selected region, so that I can bail myself out and not have to draw the same selection twice.
- steveruizok 5y agoJust replied to another commenter with the same feedback, but agreed that there are times where you want to stick with one of those shapes. Double click on the shape in the toolbar to keep it selected!