ExcalidrawProps
Complete reference for all props accepted by the<Excalidraw /> component.
Event Handlers
Called whenever elements, appState, or files change.
Called for incremental updates to optimize performance in collaborative scenarios.
Called when pointer position or state changes.
Custom paste handler. Return
true to prevent default paste behavior.Called when elements are duplicated (via mouse-drag, keyboard, paste, library insert, etc.).Return modified elements to override the default duplication behavior. You should return all elements including deleted ones, and avoid mutating the original elements.
Called when pointer down event occurs.
Called when pointer up event occurs.
Called when canvas scroll position or zoom changes.
Called when a user starts or stops following another user in collaboration mode.
Called when the library items change.
Called when a link on an element is clicked.
Initial State
Initial data to populate the canvas. Can be a static object, a Promise, or a function returning a Promise.See InitialData for the complete structure.
API Access
Callback that receives the Excalidraw imperative API instance. Use this to access methods for programmatic control.
Collaboration
Indicates whether collaboration mode is active. Enables collaboration-specific UI features.
Custom Rendering
Custom UI renderer for the top-left corner of the canvas.
Custom UI renderer for the top-right corner of the canvas.
Custom stats panel renderer.
Custom renderer for embeddable elements (iframes, embeds).
Editor State
When
true, enables view-only mode. Users cannot edit the canvas.When
true, enables zen mode which hides the UI for a distraction-free experience.When
true, enables the grid on the canvas.When
true, enables snapping objects to other objects and guides.The visual theme of the editor.
The name of the drawing. Displayed in the UI and used as the default filename for exports.
Localization
Language code for the UI. Supports multiple languages.Examples:
"en", "es", "fr", "de", "zh-CN", "ja", etc.UI Configuration
Configuration object for UI features and canvas actions.See UIOptions for the complete reference.
Interaction
When
true, enables automatic scroll detection when the user drags elements near the edge of the viewport.When
true, Excalidraw keyboard shortcuts work even when the canvas is not focused.When
true, automatically focuses the canvas on mount.When
true, renders custom scrollbars for the canvas.Files & Assets
Custom ID generator for uploaded files.
URL to redirect to when closing the library. Used for custom library integrations.
Links & Embeds
Generates a shareable link for the selected element or group.
Validates whether a URL can be embedded in the canvas.
boolean: Enable/disable all embedsstring[]: Whitelist of allowed domainsRegExp | RegExp[]: Pattern(s) to match allowed URLsfunction: Custom validation function
Features
When
true, enables AI-powered features (text-to-diagram, etc.).When
true, shows deprecated font options in the font selector.Children
Custom React components to render inside the Excalidraw container.Useful for adding custom overlays, modals, or other UI elements that need to be rendered within the Excalidraw context.