Formats

Pattern
Canvas Draw Artifact
Excalidraw whiteboard artifact with data-whiteboardDelta streaming, uncontrolled canvas, SVG/PNG/.excalidraw export, scene templates (architecture, user flow, org chart), and in-memory versions. No database persistence.
IntermediateApr 2026View the full pattern on desktop


Problems solved
- Stream Excalidraw scene JSON with data-whiteboardDelta UI parts
- Draw on an uncontrolled Excalidraw canvas inside the artifact
- Export SVG, PNG, or .excalidraw files
- Start from architecture, user-flow, or org-chart scene templates
Use cases
- Architecture whiteboarding agents
- User-flow mapping sessions
- Org chart drafting in chat
- Excalidraw artifact prototypes
AI SDK APIs
streamTextcreateUIMessageStreamgatewaytoolconvertToModelMessagescreateUIMessageStreamResponse
Tags
aiexcalidrawwhiteboarddiagramarchitecturestreamingai-sdkartifacts
Requirements
- Node.js
- 24+
- Memory
- 256MB
- Other
- Vercel AI Gateway API key
Environment variables
AI_GATEWAY_API_KEYGet key
External services
openaiupstash
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktop






