David LuzarandMark Tolmacs 548eff0c3d feat(packages/excalidraw): [ui] rewrite ui regions (#11787)
* feat(packages/excalidraw): [ui] rewrite ui regions

* feat(packages/excalidraw): [ui] keep footer + status overlay within editor bounds

The top and center regions move into `.exc-region-mesh`, a sibling of
`.exc-region-bottom` inside `.exc-regions` (a `minmax(0,1fr) auto`
two-row grid). The footer band and the toast/scroll-back overlay no
longer share column tracks with the top row, so wide top-left/top-right
content can no longer push them past the editor edge, and nothing in the
footer can displace the toolbar.

The mesh's side columns keep their content floors (`minmax(auto, 1fr)`),
so the top row negotiates width as in production: toolbar exactly
centered while both sides fit, shifted aside once one side outgrows its
share, and overflowing to the right (clipped at the editor edge) only
when nothing fits. Host slots stay rigid at their intrinsic width; the
collaborator list is the one flexible piece, collapsing avatars into the
"+N" pill (flex-basis 0, so the avatar-count ResizeObserver can't feed
back into layout). The desktop top-right occupants are wrapped in the
shared `.exc-region-top-right-content` cluster.

Claude Opus 5.5 (xhigh)

* feat(packages/excalidraw): [ui] flush UI area with docked sidebar

The layer-ui wrapper (and with it the ViewportStatusFrame border, which
tracks its width) now stops at a docked sidebar's visible edge instead
of the --right-sidebar-width column it reserves — the sidebar's 8px
outer margin was a dead gap between the UI area and the sidebar. The
regions container compensates with a matching right inset so
right-aligned UI (and the status stack's center) keeps its previous
visual position.

Also moves the in-flow mobile bottom-bar status-stack rule inside the
mobile block: it must out-rank the standalone mobile stack rule (which
re-adds the absolute positioning the regions model removed from the
base rule), else the scroll-back button paints over MobileShapeActions
instead of stacking above it.

Claude Fable 5

* feat(packages/excalidraw): [ui] stack top + center regions in three columns

Replaces the 3×4 mesh with three column stacks: each column is a flex
column of its top region and the center region below it, so a center
region clears exactly its own column's top region. The mesh needed
spanning rows that absorb overhangs to express the same dependencies,
plus the invariant that only the top regions may occupy a single track.

Only the top regions size the columns: the center regions have
`contain: inline-size`, so a wide styles panel overflows toward the
canvas instead of widening its column and offsetting the toolbar. The
top-row width negotiation is unchanged (`minmax(auto,1fr) auto
minmax(auto,1fr)`), and a real column-gap replaces the toolbar's inline
margins now that there are no zero-height rows for gaps to double up in.

Behavior change: the stats panel now clears only the top-right UI — a
top-left UI taller than the top-right no longer pushes it down. The
empty center-center region is dropped, and the status stack is
absolutely positioned against `.exc-regions` instead of being a grid
item spanning both rows.

Claude Opus 5.5 (xhigh)

* fix(packages/excalidraw): [ui] bound the stats panel; RTL docked-sidebar inset

The stats panel now scrolls within its region like the styles panel,
instead of running past the footer and covering the help button in
short windows.

The inset that keeps region content clear of a docked sidebar used a
physical `right`, but the sidebar docks on the left in RTL — so the 8px
went to the free edge and the toolbar sat 4px off. It's now
`inset-inline-end`.

Claude Opus 5.5 (xhigh)

* feat(packages/excalidraw): [ui] make regions positioning contexts

Every region is now `position: relative`, so absolutely positioned host
content anchors to its own region. Excalidraw+ hangs its call tray below
the top-right UI with `absolute top-10 right-0`; without a positioned
region it anchored to `.exc-regions` instead, which lands in the same
spot in LTR only by coincidence and on the wrong side in RTL.

Claude Opus 5.5 (xhigh)

* feat(packages/excalidraw): [ui] render host top-right UI alongside defaults on phone

On phones, `renderTopRightUI` content used to replace the editor's
top-right controls (sidebar trigger, pen-mode button) — any non-nullish
return value hid them. It now renders next to them, same as on desktop
and as before the new mobile layout (#9996). excalidraw.com returns
null on phones, so it's unaffected; Excalidraw+ already patched its
fork to render both.

Claude Opus 5.5 (xhigh)

* feat: Progressive collapse

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* feat: Region API with priority-based collapse and overflow menu

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* feat: Vertical and footer region collapse, phone mapping, status stack placement

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* fix(packages/excalidraw): [ui] let shrink items shrink in the top-left region

The floor counts shrink items at their minWidth, but the top-left grid
track sized to the content's min-content, so a nowrap item (e.g. a host
scene name) overflowed the region under the toolbar instead of truncating.

Claude Opus 5.5 (reasoning: xhigh)

* fix(packages/excalidraw): [ui] region floors stuck at 0 or too small

- compute the floor before the budget check: a floor measured before the
  items' tunneled content rendered (0px) shrank the region to 0, which
  left no budget, so the floor was never re-measured (fresh load at a
  narrow width put the top-right UI over the toolbar)
- count gaps for displayed zero-width items (e.g. absolutely positioned
  host content), which still take a gap in the row
- user list minWidth includes the current user's pill (57px, not 36px)

Claude Opus 5.5 (reasoning: xhigh)

* fix(packages/excalidraw): [ui] compute the toolbar fold count analytically

Every foldable tool is as wide as the hand tool, so the fold count is a
closed-form function of the region's width — no fold-and-remeasure loop.
Folds land in the same frame as the resize (flushSync in the
ResizeObserver), resize down/up end in the same state, and an open "more
tools" menu no longer corrupts the cached tool widths (it ratcheted the
toolbar track until reload).

* fix(packages/excalidraw): [ui] measure the editor interface before first paint

The constructor can't measure the container, so the first render always
assumed a desktop editor with the full UI; a tablet-sized editor painted
the full toolbar and switched to the compact one on some later render.

* fix(packages/excalidraw): [ui] no layout shifts around the collaborator list

- floored top-right content can shrink to the floor, so the list no longer
  renders a frame with the avatars of its previous width (overflowing
  under the toolbar)
- the list re-renders in its ResizeObserver callback, before paint (it was
  a frame late e.g. when a host item next to it appeared)
- the list is as tall as the buttons next to it (it grew the row by 1px)

* feat(packages/excalidraw): [ui] replace region "⋯" menus with collapse="hide"

A second "⋯" next to the toolbar's own is confusing. Items now either
adapt (`render`) or go away (`hide`, with 32px to spare), on desktop and
phone. The stats panel just scrolls down to 120px, like the styles panel.

* feat(packages/excalidraw): [ui] keep region items collapsed on tablets

The compact UI below 1180px frees room, so items collapsed at a wider
editor expanded again — they came and went while resizing.

* fix(packages/excalidraw): [ui] don't clip the styles and stats panel shadows

Their region items were scroll containers on top of the panels' own
scrolling.

* feat(excalidraw-app): [ui] hide the promo while collaborating or when it doesn't fit

* fix(packages/excalidraw): [ui] keep the styles panel clear of the minimap

The minimap (from master, ported into the bottom-left region) floats above
the canvas actions, in the left column's way. Its region now stops above
it — the region's budget follows, so the panel scrolls — instead of the
hardcoded MINIMAP_RESERVED_HEIGHT the old max-height used.

* fix(packages/excalidraw): [ui] phone: "more tools" menu opens above the scroll-back button

The status stack kept its z-index inside the bottom bar (it applies to a
static flex item too), which put it above the toolbar's menu.

* fix(packages/excalidraw): [ui] RTL: follow frame inset on the docked sidebar's side

The inset was a physical `right`, but the sidebar docks on the left in
RTL: the frame was drawn over the sidebar and left a sidebar-wide strip of
canvas outside it.

---------

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
2026-12-02 20:22:50 +01:00
2026-12-01 22:17:47 +01:00
2020-04-03 19:19:01 +02:00
2026-12-01 22:17:47 +01:00
2024-09-09 17:12:07 +02:00
2020-09-15 21:59:00 +02:00
2026-12-01 22:17:47 +01:00
2026-12-01 22:17:47 +01:00
2026-12-01 22:17:47 +01:00
2020-01-05 13:09:29 -08:00
2026-12-01 22:17:47 +01:00
2026-12-01 22:17:47 +01:00

Excalidraw whiteboard: hand-drawn like diagrams, real-time collaboration, end-to-end encrypted, free and open source

Excalidraw Editor · Documentation · npm · Blog · Excalidraw+

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

An open source virtual whiteboard with a hand-drawn style, collaborative and end-to-end encrypted. Sketch diagrams, wireframes or whatever you like at excalidraw.com, or embed the editor in your own app with the @excalidraw/excalidraw React component.

Features

The Excalidraw editor (npm package) supports:

  • 💯 Free and open source: MIT licensed.
  • 🎨 Infinite canvas: zoom and pan without running out of room, with a minimap to find your way around.
  • ✍️ Hand-drawn style: shapes, arrows and text that look sketched, with a choice of fonts, in light or dark mode.
  • ⚒️ Wide range of tools: rectangle, diamond, ellipse, arrow, line, free-draw, text, sticky notes, frames, web embeds, laser pointer, eraser and more.
  • ➡️ Arrows that follow your shapes: arrow binding, labeled arrows and elbow arrows.
  • 🔀 Flowcharts from the keyboard: Ctrl/Cmd+arrow keys add the next node, Alt+arrow keys move between nodes.
  • 🧜 Mermaid diagrams: paste a Mermaid definition and get shapes you can keep editing, with Mermaid to Excalidraw.
  • 📊 Charts: paste spreadsheet data and get a bar, line or radar chart.
  • 📷 Images and shape libraries: drop in images and crop them, and reuse shapes from public libraries or your own.
  • 🔍 Command palette and search: run any action, or find text in the scene, from the keyboard.
  • 🖼️ Export to PNG, SVG and clipboard: or save the drawing as an .excalidraw JSON file, an open format.
  • 🌐 Localization (i18n): translated by the community.
  • 🏗️ Customizable: props, an imperative API and UI you can extend when you embed it.

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: draw together in the same scene.
  • 🔒 End-to-end encryption: the server can't read what you draw.
  • 💾 Local-first: autosaves to the browser.
  • 🔗 Shareable links: export to a read-only link you can share with others.
  • ✨ Generative AI: text to diagram and wireframe to code.

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

Quick start

Note: the 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, yarn or pnpm to install the package.

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

To try unreleased changes, use @excalidraw/excalidraw@next.

import { Excalidraw } from "@excalidraw/excalidraw";
import "@excalidraw/excalidraw/index.css";

export default function App() {
  return (
    <div style={{ height: "100vh" }}>
      <Excalidraw />
    </div>
  );
}

Excalidraw fills its parent, so the parent needs a height. See installation and integration for Next.js and other setups.

Excalidraw+

Excalidraw+ is the hosted workspace for teams, built on this editor. Using it also supports the open source project. On top of everything above, you get:

  • ☁️ Unlimited scenes, saved to the cloud: organized in collections, with a dashboard to find them again.
  • 👥 Team workspaces: access management, sharing with edit or view rights, read-only links and embeds.
  • 💬 Comments, voice hangouts and screensharing: discuss a scene where you draw it.
  • 🎞️ Presentations: turn frames into slides, present them live and export them to PDF or PPTX.
  • ✨ More AI: 100 requests a day for text to diagram and wireframe to code, or bring your own key.
  • 🤖 MCP server and REST API: let AI agents and scripts read and edit your scenes. See the MCP and API docs.
  • 🔌 Integrations: bring your scenes into the tools your team already works in.
  • 🏢 Enterprise ready: SSO (SAML or OIDC), admin controls for sharing and AI, and audit logs.
  • 🔐 Security: two-factor authentication that admins can require of every member, encryption at rest and in transit, daily backups and SOC 2 Type 2. See security and compliance.

Try Excalidraw+ free for 14 days · Pricing

Excalidraw CLI

The Excalidraw CLI brings Excalidraw to your terminal, scripts and AI agents. It renders drawings and converts Mermaid diagrams on your computer, free and without an account:

npx @excalidraw/cli render drawing.excalidraw --out drawing.png
npx @excalidraw/cli mermaid flow.mmd --out flow.excalidraw

Log in to Excalidraw+ and it manages your workspace too: scenes, collections, share links and presentations. excalidraw mcp gives AI agents the Excalidraw+ drawing tools through the same login. See the CLI docs.

Documentation

📚 plus.excalidraw.com/docs/sdk

Contributing

Integrations

Who's integrating Excalidraw

Google Cloud • Meta • CodeSandbox • Obsidian Excalidraw • Replit • Slite • Notion • HackerRank • 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

Languages
TypeScript 94.1%
SCSS 2.5%
JavaScript 1.6%
MDX 1.4%
HTML 0.4%