TLDOCUMENT_ID

See source code

The fixed ID for the singleton document record in every tldraw store. All document records use this same ID: 'document:document'

TLDOCUMENT_ID: RecordId<TLDocument>;

Example

// Get the document from store
const document = store.get(TLDOCUMENT_ID);

// Update document settings
store.put([
  {
    ...document,
    name: "Updated Name",
    gridSize: 25,
  },
]);

// Access via editor
const documentSettings = editor.getDocumentSettings();
editor.updateDocumentSettings({ name: "New Name" });
Prev
TL_SCRIBBLE_STATES
Next
TLINSTANCE_ID