Props

All props are optional. Full reference: docs.excalidraw.com.

NameTypeDescription
initialDataobject | null | Promise<object|null>Initial data with which app loads
excalidrawAPIfunctionCallback with the excalidraw API once rendered
isCollaboratingbooleanCollaboration mode
onChangefunctionTriggered on any change; receives elements and appState
onPointerUpdatefunctionMouse pointer updates
onPointerDownfunctionPointer down events
onPointerUpfunctionPointer up events
onScrollChangefunctionCanvas scroll
onDuplicatefunctionElement duplication; can return modified elements
onPastefunctionPaste into scene
onLibraryChangefunctionLibrary updates
generateLinkForSelectionfunctionOverride URL generation for links
onLinkOpenfunctionLink opened
langCodestringLanguage (default en)
onUserFollowfunctionFollow/unfollow (collaboration)
onIncrementfunctionDurable/ephemeral increment events
renderTopLeftUIfunctionCustom UI top-left
renderTopRightUIfunctionCustom UI top-right
renderCustomStatsfunctionCustom stats in stats dialog
viewModeEnabledbooleanView mode
zenModeEnabledbooleanZen mode
gridModeEnabledbooleanGrid mode
objectsSnapModeEnabledbooleanSnap-to-grid
libraryReturnUrlstringLibraries.excalidraw.com return URL
theme"light" | "dark"Theme (default light)
namestringDrawing name
UIOptionsobjectUI options (canvas actions, etc.)
detectScrollbooleanUpdate offsets on scroll (default true)
handleKeyboardGloballybooleanBind keyboard to document
autoFocusbooleanFocus on load
generateIdForFilefunctionOverride ID for files
validateEmbeddablevariousCustom src validation
renderEmbeddablefunctionOverride built-in iframe
renderScrollbarsbooleanShow scrollbars
showDeprecatedFontsbooleanDeprecated fonts in picker
childrenBuilder(mod) => React.ReactNodeCustom children (MainMenu, WelcomeScreen, etc.)