ConfigsApr 7, 2026·2 min read

tldraw — Infinite Canvas SDK for AI Applications

Open-source infinite canvas library for building whiteboard, diagramming, and design applications. React component with real-time collaboration. Used by AI tools for visual generation. 40,000+ stars.

AI
AI Open Source · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

npm install tldraw
import { Tldraw } from "tldraw";
import "tldraw/tldraw.css";

export default function App() {
  return (
    <div style={{ width: "100vw", height: "100vh" }}>
      <Tldraw />
    </div>
  );
}

A full whiteboard in 5 lines of React code.


Intro

tldraw is an open-source infinite canvas library for building whiteboard, diagramming, and design applications with 40,000+ GitHub stars. Drop a React component into your app and get a full-featured drawing canvas with shapes, text, images, collaboration, and export. AI companies use tldraw for visual generation — draw a wireframe and have AI turn it into code, or generate diagrams from text descriptions. Best for developers building collaborative or visual AI applications. Works with: React, Next.js. Setup time: under 1 minute.


Key Features

Full Canvas in One Component

<Tldraw />

Includes: freehand drawing, shapes, text, images, arrows, frames, sticky notes, embed, and more.

AI Integration Patterns

Draw-to-Code:

1. User draws a wireframe on tldraw canvas
2. Export as SVG/PNG
3. Send to Claude/GPT-4 Vision
4. AI generates React code from the drawing

Text-to-Diagram:

1. User describes: "API gateway connecting to 3 microservices"
2. AI generates tldraw JSON
3. Diagram appears on canvas

SDK for Custom Apps

import { createTLStore, defaultShapeUtils } from "tldraw";

const store = createTLStore({ shapeUtils: defaultShapeUtils });

// Programmatically add shapes
store.createShapes([
  {
    type: "geo",
    x: 100, y: 100,
    props: { geo: "rectangle", w: 200, h: 100, text: "API Gateway" },
  },
]);

Real-Time Collaboration

import { Tldraw, useSync } from "tldraw";

function CollabCanvas() {
  const store = useSync({ uri: "wss://your-server.com/room/123" });
  return <Tldraw store={store} />;
}

Export Options

  • SVG (vector, scalable)
  • PNG (raster, screenshots)
  • JSON (tldraw format, re-editable)
  • Clipboard (paste into other tools)

Used By

  • Vercel (internal tools)
  • Cal.com (scheduling diagrams)
  • AI wireframe tools
  • Notion-like apps with drawing features

Key Stats

  • 40,000+ GitHub stars
  • React component library
  • Real-time collaboration
  • AI draw-to-code pattern
  • SVG/PNG/JSON export

FAQ

Q: What is tldraw? A: An open-source infinite canvas React library for building whiteboard and diagramming applications, used by AI tools for visual generation.

Q: Is tldraw free? A: Yes, open-source under Apache 2.0 for the SDK. tldraw.com (hosted) has free and paid tiers.

Q: Can AI generate tldraw content? A: Yes, AI can generate tldraw JSON shapes programmatically, and tldraw canvas exports can be sent to vision models for analysis.


🙏

Source & Thanks

Created by tldraw. Licensed under Apache 2.0.

tldraw — stars 40,000+

Thanks for making the infinite canvas a React component.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.