Component props reference for dash_excalidraw.

API reference

dash_excalidraw

DashExcalidraw

DashExcalidraw is an Excalidraw drawing canvas bound to Dash via a JSON-safe prop surface. See the per-prop docs above for the full catalog; see the README for the command/event round-trip pattern used for imperative actions like exports.

proptypedefaultdescription
idstringUnique ID to identify this component in Dash callbacks.
UIOptionsdictSubset of Excalidraw UIOptions that is JSON-serializable. Use this to toggle individual canvas actions, show/hide the welcome screen, etc.
appStateobjectOfFull serializable app state (view background, zoom, scroll, grid mode, zen mode, theme, active tool, …). Read-only from Python.
autoFocusboolFocus the canvas on mount. @,default,true
commanddictWrite to this prop from a Python callback to dispatch an imperative action into Excalidraw. Shape: ``python {"id": "unique-string", "type": "updateScene", "payload": {...}} ` Supported type values: - updateScene / resetScene / addFiles - scrollToContent / setActiveTool / setToast / toggleSidebar - updateLibrary - exportToSvg / exportToBlob / exportToCanvas Each dispatch is de-duplicated by id, and the component clears the prop (sets it to None`) once the action completes so React re-renders do not re-fire.
detectScrollboolWhether Excalidraw listens to wheel-scroll events on the canvas. @,default,true
elementslist of objectOfCurrent Excalidraw element array. Written via setProps on every scene change — read-only from Python callbacks.
externalizedSerializedDatastringSame envelope as serializedData, but every files[*].dataURL that still holds an inline data: URI is replaced with null. External URLs (those dispatched via the replaceFiles command) are retained as-is. Persist this variant to avoid paying the base64 cost; inline bytes can be rehydrated later via dash_excalidraw.helpers.restore_inline_files.
filesobjectOfMap of binary file entries (image id -> {dataURL, mimeType, ...}). Read-only from Python.
gridModeEnabledboolSnap to grid and draw the grid background. @,default,false
handleKeyboardGloballyboolWhen true, keyboard shortcuts work even when the canvas is not focused. Turn off if your Dash app has other inputs that might conflict. @,default,true
heightstringCSS height of the canvas container. Excalidraw fills its parent, so this is the number to change when the canvas looks too short. @,default,"600px"
hideExcalidrawLinksboolWhen true (default), injects CSS that hides Excalidraw's built-in "Excalidraw links" menu group (GitHub / Discord / Twitter). Set to false if you actually want those links visible to users.
initialDatadictInitial scene contents passed to Excalidraw on mount. Shape: {elements, appState, files, libraryItems, scrollToContent}. Updating this prop after mount has no effect — use command with type="updateScene" to change the scene imperatively.
interceptLinkOpensboolWhen true, the wrapper calls event.preventDefault() on every lastLinkOpen event so Python can handle the click itself (typically by opening a dmc.Drawer). Default false — links open in a new tab normally.
isCollaboratingboolRenders the "currently-editing" collaborator UI. You'll also need to feed appState.collaborators; the wrapper does not bundle a transport layer. @,default,false
langCodestringUI language code (e.g. en, fr-FR, zh-CN). @,default,"en"
lastExportobjectOfResult of the most recent export command: {timestamp, id, type, result, error?}. Match id against the command you dispatched to correlate responses.
lastExternalDropobjectOfFires when the wrapper's drop handler intercepts a drop that Excalidraw itself doesn't accept (non-image files, or any multi- file drop). Payload: { timestamp, files: [{name, mimeType, dataURL, size}, ...], dropPoint: {x, y}, # scene coords placeholderIds: [elemId, ...], # one id per non-image file, # pointing at the rectangle we # placed on the canvas so you # can update its link after # upload. }
lastFileAddedobjectOfFires when one or more new file ids appear in files with an inline data: dataURL. Payload: { timestamp, fileId, mimeType, dataURL, size, # first new file (back-compat) files: [ {fileId, mimeType, dataURL, size}, ... # every new file in this change ], } Single-file callbacks can keep reading event['fileId']; batch callbacks iterate event['files']. size is decoded byte count.
lastLibraryChangeobjectOfSnapshot of the last library change {timestamp, items}.
lastLinkOpenobjectOfSnapshot of the last link-open event {timestamp, elementId, url} — fired when a user Cmd/Ctrl-clicks an element with a hyperlink.
lastPasteobjectOfSnapshot of the last clipboard paste {timestamp, data}. The wrapper cannot cancel the paste from Python; if you need to intercept, clean up in a follow-up callback that modifies scene state afterward.
lastPointerDownobjectOfSnapshot of the last pointer-down event: {timestamp, activeTool, pointer: {x, y}}.
lastPointerMoveobjectOfThrottled pointer-move snapshot {timestamp, pointer, button, pointersMap}. Throttled by pointerMoveThrottleMs (default 50 ms).
lastPointerUpobjectOfSnapshot of the last pointer-up event: {timestamp, activeTool, pointer: {x, y}}.
lastScrollChangeobjectOfThrottled scroll/zoom snapshot {timestamp, scrollX, scrollY}.
libraryReturnUrlstringOptional URL appended to the "Browse Library" button in the sidebar. When unset Excalidraw uses its own default.
namestringDrawing name — appears in the top bar and in serialized export filenames.
pointerMoveThrottleMsnumberDebounce interval for lastPointerMove writes (milliseconds). @,default,50
sceneVersionnumberMonotonic scene version from excalidrawAPI.getSceneVersion(). Useful for change detection without diffing element arrays.
scrollThrottleMsnumberDebounce interval for lastScrollChange writes (milliseconds). @,default,100
serializedDatastringJSON string of the canonical Excalidraw serialized envelope {type, version, source, elements, appState, files}. Suitable to pass to dash.dcc.Store and later restore via initialData.
themeone of 'light', 'dark'Canvas color theme. @,default,"light"
validateEmbeddablebool \list of stringControls which URLs may be embedded inside Excalidraw frames. Pass true to allow all, false to deny all, or a list of domain-glob strings (e.g. ["*.youtube.com", "excalidraw.com"]) which the wrapper compiles to case-insensitive RegExps.
viewModeEnabledboolView-only mode: disables drawing tools; pan/zoom still available. @,default,false
widthstringCSS width of the canvas container. @,default,"100%"
zenModeEnabledboolZen mode hides most of the chrome for a distraction-free canvas. @,default,false

Note for AI agents: This is the static, prerendered view of an interactive Dash application served because we detected a non-JS user agent. Full prose docs: