Component props reference for dash_excalidraw.

API reference

dash_excalidraw

DashExcalidraw

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
docsLinkLabelstringVisible label for the docsLinkUrl item. Re-point the URL and you should relabel: a menu entry that names one destination and opens another is the failure this pair exists to avoid. @,default,"dash-excalidraw docs"
docsLinkUrlstringURL for the wrapper's own documentation item in the main menu. Rendered as its own group, independently of hideExcalidrawLinks. Set to "" or None to render no item at all. @,default,"https://excalidraw.2plot.dev"
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), the vendor's "Excalidraw links" group (GitHub / Follow us / Discord) is not rendered. Set false to show it. This is a render condition on THIS canvas's menu, so it works in both directions and each canvas on a page decides for itself. @,default,true
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 the package's getSceneVersion(elements) export. Useful for change detection without diffing element arrays. It tracks ELEMENTS only. Registering a file, panning or zooming leaves it unchanged, so a callback that must see those should take files or appState as its Input rather than this.
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
welcomeSceneobjectOfA scene to open with when initialData is not given: {elements, appState, files}, the same shape initialData and externalizedSerializedData use, so a scene produced anywhere in this library can be pasted straight in. MOUNT-ONLY, like initialData — Excalidraw owns the scene afterwards. Dispatch updateScene to change it later.
welcomeScreenboolShow Excalidraw's welcome overlay on an empty canvas. REACTIVE, unlike UIOptions.welcomeScreen. The vendor reads that key once while the canvas is mounting, so a switch wired to it appears to do nothing — which is exactly how it read. This works by composing Excalidraw's <WelcomeScreen> as a CHILD, which React mounts and unmounts with the prop. MEASURED, because the obvious alternative looks right and is not: appState.showWelcomeScreen exists, but updateScene({appState: {showWelcomeScreen: false}}) leaves it true — the vendor filters that key out of the merge, silently. Do not "fix" this back to an appState push.
welcomeScreenContentdictWords for the welcome overlay: {title, subtitle}. Either may be omitted. Supplying neither keeps Excalidraw's own wording. Only the TEXT is yours — the overlay's menu hints stay the vendor's, so they cannot drift out of step with the menu they describe.
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: