Skip to main content

Package Installation

1

Install via npm, yarn, or pnpm

Excalidraw requires React and React DOM as peer dependencies. Install the package using your preferred package manager:
React Version Support: Excalidraw supports React 17, 18, and 19. The package is compatible with react@^17.0.2 || ^18.2.0 || ^19.0.0.
2

Import Excalidraw and styles

Import the Excalidraw component and its required CSS file in your application:
3

Add the component to your app

Add Excalidraw to your component. Make sure the parent container has explicit dimensions:
Container Dimensions Required: Excalidraw takes 100% of the width and height of its containing block. Ensure the parent element has non-zero dimensions, or the canvas will not be visible.

Framework-Specific Setup

Next.js

Next.js requires dynamic imports with SSR disabled to avoid hydration issues.
1

Create a wrapper component

Create a client component that imports Excalidraw:
excalidrawWrapper.tsx
2

Import with dynamic loading

In your page component, use Next.js dynamic imports with ssr: false:
app/page.tsx

Vite

Vite works out of the box with Excalidraw. Simply import and use:

Create React App

Create React App also works without additional configuration:

Self-Hosting Fonts

For production deployments, you should self-host Excalidraw fonts instead of loading them from a CDN.
1

Copy font files to your public directory

Copy the fonts from node_modules/@excalidraw/excalidraw/dist/prod/fonts to your public directory:
The fonts directory includes all font families used by Excalidraw: Virgil (hand-drawn style), Cascadia, Assistant, and more.
2

Set the asset path

Configure window.EXCALIDRAW_ASSET_PATH to point to your public directory where fonts are hosted:In HTML:
In Next.js:
In React:
If you don’t set EXCALIDRAW_ASSET_PATH, Excalidraw will attempt to load fonts from the CDN at https://esm.run/@excalidraw/excalidraw/dist/prod/. This works fine for development but may cause issues in production or offline environments.

Browser Compatibility

Excalidraw supports modern browsers with the following minimum versions:

Chrome / Edge

Version 70+

Firefox

Latest version

Safari

Version 12+

Mobile Browsers

Safari iOS 12+, Chrome Android
Not supported:
  • Internet Explorer (any version)
  • Opera Mini
  • UC Browser < 13
  • Samsung Internet < 10
  • KaiOS ≤ 2.5

TypeScript Support

Excalidraw is written in TypeScript and includes full type definitions. No additional @types packages are needed.

Available Type Exports

Import types from the appropriate subpackages:

Additional Packages

Excalidraw exports additional utility packages for advanced use cases:
Common utilities and constants:
Element manipulation utilities:
Mathematical utilities for geometry calculations:
Export and utility functions:

Using the Latest (Unreleased) Version

To try unreleased features and bug fixes before the next stable release:
The @next tag includes unreleased changes that may be unstable. Only use this in development or if you need a specific fix that hasn’t been released yet.

Next Steps

Quick Start

Get drawing in 5 minutes with our quick start guide

API Reference

Explore all available props and methods

Examples

See real-world integration examples

Customization

Learn how to customize the UI and theme