Skip to main content

ExcalidrawProps

Complete reference for all props accepted by the <Excalidraw /> component.

Event Handlers

function
Called whenever elements, appState, or files change.
function
Called for incremental updates to optimize performance in collaborative scenarios.
function
Called when pointer position or state changes.
function
Custom paste handler. Return true to prevent default paste behavior.
function
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.
function
Called when pointer down event occurs.
function
Called when pointer up event occurs.
function
Called when canvas scroll position or zoom changes.
function
Called when a user starts or stops following another user in collaboration mode.
function
Called when the library items change.
Called when a link on an element is clicked.

Initial State

ExcalidrawInitialDataState | (() => Promise<ExcalidrawInitialDataState | null>) | null
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

function
Callback that receives the Excalidraw imperative API instance. Use this to access methods for programmatic control.

Collaboration

boolean
default:"false"
Indicates whether collaboration mode is active. Enables collaboration-specific UI features.

Custom Rendering

function
Custom UI renderer for the top-left corner of the canvas.
function
Custom UI renderer for the top-right corner of the canvas.
function
Custom stats panel renderer.
function
Custom renderer for embeddable elements (iframes, embeds).

Editor State

boolean
default:"false"
When true, enables view-only mode. Users cannot edit the canvas.
boolean
default:"false"
When true, enables zen mode which hides the UI for a distraction-free experience.
boolean
default:"false"
When true, enables the grid on the canvas.
boolean
default:"false"
When true, enables snapping objects to other objects and guides.
'light' | 'dark'
default:"'light'"
The visual theme of the editor.
string
The name of the drawing. Displayed in the UI and used as the default filename for exports.

Localization

string
Language code for the UI. Supports multiple languages.Examples: "en", "es", "fr", "de", "zh-CN", "ja", etc.

UI Configuration

Partial<UIOptions>
Configuration object for UI features and canvas actions.See UIOptions for the complete reference.

Interaction

boolean
default:"true"
When true, enables automatic scroll detection when the user drags elements near the edge of the viewport.
boolean
default:"false"
When true, Excalidraw keyboard shortcuts work even when the canvas is not focused.
boolean
default:"false"
When true, automatically focuses the canvas on mount.
boolean
default:"true"
When true, renders custom scrollbars for the canvas.

Files & Assets

function
Custom ID generator for uploaded files.
string
URL to redirect to when closing the library. Used for custom library integrations.
Generates a shareable link for the selected element or group.
boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined)
Validates whether a URL can be embedded in the canvas.
  • boolean: Enable/disable all embeds
  • string[]: Whitelist of allowed domains
  • RegExp | RegExp[]: Pattern(s) to match allowed URLs
  • function: Custom validation function

Features

boolean
default:"true"
When true, enables AI-powered features (text-to-diagram, etc.).
boolean
default:"false"
When true, shows deprecated font options in the font selector.

Children

React.ReactNode
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.

Type Definitions