Virtual whiteboard for sketching hand-drawn like diagrams
Find a file
Ryan Di 195a743874
Some checks failed
Auto release excalidraw next / Auto-release-excalidraw-next (push) Failing after 47s
Build Docker image / build-docker (push) Successful in 2m4s
Cancel previous runs / cancel (push) Failing after 3s
Publish Docker / publish-docker (push) Failing after 1m42s
New Sentry production release / sentry (push) Failing after 12s
feat: switch between basic shapes (#9270)
* feat: switch between basic shapes

* add tab for testing

* style tweaks

* only show hint when a new node is created

* fix panel state

* refactor

* combine captures into one

* keep original font size

* switch multi

* switch different types altogether

* use tab only

* fix font size atom

* do not switch from active tool change

* prefer generic when mixed

* provide an optional direction when shape switching

* adjust panel bg & shadow

* redraw to correctly position text

* remove redundant code

* only tab to switch if focusing on app container

* limit which linear elements can be switched

* add shape switch to command palette

* remove hint

* cache initial panel position

* bend line to elbow if needed

* remove debug logic

* clean switch of arrows using app state

* safe conversion between line, sharp, curved, and elbow

* cache linear when panel shows up

* type safe element conversion

* rename type

* respect initial type when switching between linears

* fix elbow segment indexing

* use latest linear

* merge converted elbow points if too close

* focus on panel after click

* set roudness to null to fix drag points offset for elbows

* remove Mutable

* add arrowBoundToElement check

* make it dependent on one signle state

* unmount when not showing

* simpler types, tidy up code

* can change linear when it's linear + non-generic

* fix popup component lifecycle

* move constant to CLASSES

* DRY out type detection

* file & variable renaming

* refactor

* throw in not-prod instead

* simplify

* semi-fix bindings on `generic` type conversion

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
2025-04-30 18:07:31 +02:00
.codesandbox chore: update required node version to 18 (#6837) 2023-07-31 23:47:41 +02:00
.github fix: usage of node12 which is deprecated (#8791) 2024-11-11 12:05:55 +01:00
.husky build: temporarily disable pre-commit (#6132) 2023-01-19 13:50:42 +01:00
dev-docs docs: Fix missing verb in Footer component documentation (#9393) 2025-04-20 12:35:38 +02:00
examples feat: add props.renderScrollbars (#9399) 2025-04-19 21:50:44 +00:00
excalidraw-app fix: remove noreferrer on internal links (#9452) 2025-04-29 18:45:17 +02:00
firebase-project fix: update storage.rules (#5020) 2022-04-17 22:47:00 +02:00
packages feat: switch between basic shapes (#9270) 2025-04-30 18:07:31 +02:00
public fix: remove manifest.json (#8783) 2024-11-09 13:42:11 +05:30
scripts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
.dockerignore fix: Docker build in CI (#8312) 2024-08-06 13:21:20 +02:00
.editorconfig add editorconfig (#1198) 2020-04-03 19:19:01 +02:00
.env.development feat: allow to disable preventUnload in dev (#9319) 2025-03-29 19:42:33 +01:00
.env.production fix: load env vars correctly and set debug and linter flags to false explicitly in prod mode (#8770) 2024-11-07 21:14:49 +00:00
.eslintignore feat: canvas search (#8438) 2024-09-09 17:12:07 +02:00
.eslintrc.json fix: remove noreferrer on internal links (#9452) 2025-04-29 18:45:17 +02:00
.gitattributes Add gitattributes (#2164) 2020-09-15 21:59:00 +02:00
.gitignore chore: release @excalidraw/excalidraw@18.0.0 🎉 (#9127) 2025-02-28 16:49:09 +01:00
.lintstagedrc.js Keep errors, elements and comments consistent (#2340) 2020-11-05 18:06:18 +01:00
.npmrc feat: color picker redesign (#6216) 2023-05-18 16:06:27 +02:00
.nvmrc chore: update required node version to 18 (#6837) 2023-07-31 23:47:41 +02:00
.prettierignore Change target branch of coverage and pretty print (#1850) 2020-07-01 12:05:21 +03:00
.watchmanconfig Don't reset cache while zooming using a gesture (#1103) 2020-03-28 16:59:36 -07:00
CONTRIBUTING.md docs: migrating dev docs to docusaurus :) (#6073) 2023-02-01 19:57:54 +05:30
crowdin.yml build: decouple package deps and introduce yarn workspaces (#7415) 2023-12-12 11:32:51 +05:30
docker-compose.yml chore: Update action versions and docker build (#3065) 2021-02-20 14:28:33 +00:00
Dockerfile fix: Docker build in CI (#8312) 2024-08-06 13:21:20 +02:00
LICENSE Add MIT License (#176) 2020-01-05 13:09:29 -08:00
package.json refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
README.md chore: release @excalidraw/excalidraw@18.0.0 🎉 (#9127) 2025-02-28 16:49:09 +01:00
setupTests.ts fix: duplication tests pointer state leaking between tests (#9414) 2025-04-18 11:11:12 +02:00
tsconfig.json refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
vercel.json feat: multiple fonts fallbacks (#8286) 2024-07-30 10:34:40 +02:00
vitest.config.mts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
yarn.lock feat: lasso selection (#9169) 2025-04-07 16:44:25 +10:00

Excalidraw

Excalidraw Editor | Blog | Documentation | Excalidraw+

An open source virtual hand-drawn style whiteboard.
Collaborative and end-to-end encrypted.


Excalidraw is released under the MIT license. npm downloads/month PRs welcome! Chat on Discord Follow Excalidraw on Twitter

Product showcase

Create beautiful hand-drawn like diagrams, wireframes, or whatever you like.

Features

The Excalidraw editor (npm package) supports:

  • 💯 Free & open-source.
  • 🎨 Infinite, canvas-based whiteboard.
  • ✍️ Hand-drawn like style.
  • 🌓 Dark mode.
  • 🏗️ Customizable.
  • 📷 Image support.
  • 😀 Shape libraries support.
  • 👅 Localization (i18n) support.
  • 🖼️ Export to PNG, SVG & clipboard.
  • 💾 Open format - export drawings as an .excalidraw json file.
  • ⚒️ Wide range of tools - rectangle, circle, diamond, arrow, line, free-draw, eraser...
  • ➡️ Arrow-binding & labeled arrows.
  • 🔙 Undo / Redo.
  • 🔍 Zoom and panning support.

Excalidraw.com

The app hosted at excalidraw.com is a minimal showcase of what you can build with Excalidraw. Its source code is part of this repository as well, and the app features:

  • 📡 PWA support (works offline).
  • 🤼 Real-time collaboration.
  • 🔒 End-to-end encryption.
  • 💾 Local-first support (autosaves to the browser).
  • 🔗 Shareable links (export to a readonly link you can share with others).

We'll be adding these features as drop-in plugins for the npm package in the future.

Quick start

Note: following instructions are for installing the Excalidraw npm package when integrating Excalidraw into your own app. To run the repository locally for development, please refer to our Development Guide.

Use npm or yarn to install the package.

npm install react react-dom @excalidraw/excalidraw
# or
yarn add react react-dom @excalidraw/excalidraw

Check out our documentation for more details!

Contributing

Integrations

Who's integrating Excalidraw

Google CloudMetaCodeSandboxObsidian ExcalidrawReplitSliteNotionHackerRank • and many others

Sponsors & support

If you like the project, you can become a sponsor at Open Collective or use Excalidraw+.

Thank you for supporting Excalidraw

Last but not least, we're thankful to these companies for offering their services for free:

Vercel Sentry Crowdin