Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.
Quick Install
bunx add-skill tldraw/tldraw -s write-docs
canvascollaborationdesigndiagramdrawinginfinite
Instructions
Loading…
Writing tldraw SDK documentation
The tldraw voice
Write like a colleague walking someone through code they know well. Confident, casual, code-first.
Characteristic patterns:
Have five minutes? Run this command...
That's pretty much it!
Let's add local persistence by passing a persistenceKey prop...
Passive voice: "can be achieved by" — just show how
Conversational asides: "(or whatever)", "(if you want)", "(just saying)"
Mechanics
Sentence case headings: "Custom shapes" not "Custom Shapes"
Active voice: "The store validates records"
Present tense: "The migration system transforms"
Contractions: it's, we've, you'll, don't
Frontmatter
---
title: Feature name
status: published
author: steveruizok
date: 3/22/2023
order: 1
keywords:
- keyword1
- keyword2
---
MDX components
API links
Use [ClassName](?) or [ClassName#methodName](?) for API references:
The [Editor](?) class has many methods. Use [Editor#createShapes](?) to create shapes.
Code highlighting
Use <FocusLines> to highlight specific lines:
<FocusLines lines={[2,6,10]}>
\`\`\`tsx
import { Tldraw } from 'tldraw'
import { useSyncDemo } from '@tldraw/sync'
\`\`\`
</FocusLines>
Images
<Image
src="/images/api/events.png"
alt="A diagram showing an event being sent to the editor."
title="Caption text here."
/>
Tables for API documentation
Use tables for listing methods, options, or properties:
| Method | Description |
| ------------------------ | ---------------------------------------------- |
| [Editor#screenToPage](?) | Convert a point in screen space to page space. |
| [Editor#pageToScreen](?) | Convert a point in page space to screen space. |
| Value | Description |
| --------- | ---------------------------------------------------- |
| `default` | Sets the initial zoom to 100%. |
| `fit-x` | The x axis will completely fill the viewport bounds. |
Code examples
Show code early, explain around it. Don't build up to code with paragraphs of context.