Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tldraw/tldraw

tldraw61.2kSEE LICENSE IN LICENSE.md3.12.1TypeScript support: included

A tiny little drawing editor.

tldraw, drawing, app, development, whiteboard, canvas, infinite

readme

tldraw

Welcome to the public monorepo for tldraw. tldraw is a library for creating infinite canvas experiences in React. It's the software behind the digital whiteboard tldraw.com.

Click here to learn about our license and pricing.

Installation

npm i tldraw

Usage

import { Tldraw } from 'tldraw'
import 'tldraw/tldraw.css'

export default function App() {
    return (
        <div style={{ position: 'fixed', inset: 0 }}>
            <Tldraw />
        </div>
    )
}

Learn more at tldraw.dev.

Local development

The local development server will run our examples app. The basic example will show any changes you've made to the codebase.

To run the local development server, first clone this repo.

Enable corepack to make sure you have the right version of yarn:

npm i -g corepack

Install dependencies:

yarn

Start the local development server:

yarn dev

Open the example project at localhost:5420.

License

The tldraw SDK is provided under the tldraw license.

You can use the tldraw SDK in commercial or non-commercial projects so long as you preserve the "Made with tldraw" watermark on the canvas. To remove the watermark, you can purchase a business license. Visit tldraw.dev to learn more.

Trademarks

Copyright (c) 2024-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.

Distributions

You can find tldraw on npm here.

Contribution

Please see our contributing guide. Found a bug? Please submit an issue.

Community

Have questions, comments or feedback? Join our discord. For the latest news and release notes, visit tldraw.dev.

Contributors

Star History

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=tldraw/tldraw&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=tldraw/tldraw&type=Date" /> Star History Chart </picture>

Contact

Find us on Twitter/X at @tldraw. You can contact us by email at hello@tldraw.com.

changelog

v3.11.0 (Thu Mar 20 2025)

🐛 Bug Fix

Authors: 1


v3.10.0 (Tue Mar 11 2025)

🐛 Bug Fix

Authors: 1


v3.9.0 (Mon Mar 03 2025)

🐛 Bug Fix

Authors: 4


v3.8.0 (Wed Feb 12 2025)

Release Notes

support react 19 (#5293)

  • tldraw now supports react 19

💄 Product Improvements

Authors: 3


v3.4.0 (Thu Oct 24 2024)

🐛 Bug Fix

Authors: 2


v3.1.0 (Wed Sep 25 2024)

🐛 Bug Fix

Authors: 3


v3.0.0 (Fri Sep 13 2024)

Release Notes

Detect multiple installed versions of tldraw packages (#4398)

  • We detect when there are multiple versions of tldraw installed and let you know, as this can cause bugs in your application

🐛 Bug Fix

💄 Product Improvements

🛠️ API Changes

  • Detect multiple installed versions of tldraw packages #4398 (@SomeHats)

Authors: 3


v2.2.0 (Tue Jun 11 2024)

🏠 Internal

Authors: 1


v2.1.0 (Tue Apr 23 2024)

Release Notes

New migrations again (#3220)

BREAKING CHANGES

  • The Migrations type is now called LegacyMigrations.
  • The serialized schema format (e.g. returned by StoreSchema.serialize() and Store.getSnapshot()) has changed. You don't need to do anything about it unless you were reading data directly from the schema for some reason. In which case it'd be best to avoid that in the future! We have no plans to change the schema format again (this time was traumatic enough) but you never know.
  • compareRecordVersions and the RecordVersion type have both disappeared. There is no replacement. These were public by mistake anyway, so hopefully nobody had been using it.
  • compareSchemas is gone. Comparing the schemas directly is no longer really possible since we introduced some fuzziness. The best thing to do now to check compatibility is to call schema.getMigraitonsSince(prevSchema) and it will return an error if the schemas are not compatible, an empty array if there are no migrations to apply since the prev schema, and a nonempty array otherwise.

    Generally speaking, the best way to check schema compatibility now is to call store.schema.getMigrationsSince(persistedSchema). This will throw an error if there is no upgrade path from the persistedSchema to the current version.

  • defineMigrations has been deprecated and will be removed in a future release. For upgrade instructions see https://tldraw.dev/docs/persistence#Updating-legacy-shape-migrations-defineMigrations

  • migrate has been removed. Nobody should have been using this but if you were you'll need to find an alternative. For migrating tldraw data, you should stick to using schema.migrateStoreSnapshot and, if you are building a nuanced sync engine that supports some amount of backwards compatibility, also feel free to use schema.migratePersistedRecord.

  • the Migration type has changed. If you need the old one for some reason it has been renamed to LegacyMigration. It will be removed in a future release.
  • the Migrations type has been renamed to LegacyMigrations and will be removed in a future release.
  • the SerializedSchema type has been augmented. If you need the old version specifically you can use SerializedSchemaV1

Show a broken image for files without assets (#2990)

  • Better handling of broken images / videos.

📚 SDK Changes

🏠 Internal

🐛 Bug Fixes

Authors: 4


v2.0.0 (Thu Feb 29 2024)

⚠️ Pushed to main

📝 Documentation

Authors: 1


v2.0.0-beta.5 (Thu Feb 29 2024)

Release Notes

tldraw_final_v6_final(old version).docx.pdf (#2998)

  • The @tldraw/tldraw package has been renamed to tldraw. You can keep using the old version if you want though!

🏠 Internal

Authors: 1