
M3E-Canvas
Introduction
M3E Canvas is an open-source, MIT-licensed, zero-backend browser sketchpad for designing application interfaces with authentic Material 3 Expressive components and converting visual flows directly into structured prompts for AI coding agents. Built as a static Next.js export (~21,000 lines of custom TypeScript without external UI library dependencies), it enables developers and product designers to drag and snap 33 hand-crafted M3E components onto phone (412×892) or desktop (1280×800) frames, link interactive screen transitions, preview spring-physics animations, and export concise layout-aware prompts (in English, Chinese, Japanese, or Korean) for tools like Claude Code, Cursor, Codex, and Gemini CLI—or delegate canvas creation directly to agents via its official MCP server.
Use Cases
- Rapid Visual-to-Prompt Translation for AI Coding Tools
Eliminate layout translation loss when vibe-coding by visually sketching multi-screen flows on a 4dp grid and exporting precise spatial, behavioral, and styling specifications for Claude Code, Cursor, Codex, or Gemini CLI. - Bidirectional AI Agent UI Co-Design via MCP
Connect the local `m3e-canvas` MCP server (`npx -y m3e-canvas`) so AI coding agents can programmatically draft UI wireframes, return a compressed URL fragment link for human visual refinement, and ingest the finalized prompt to implement the app. - Interactive Click-Through & Swipe Prototype Verification
Wire tap and swipe triggers across multiple screens with directional slide, fade, expand, or reverse-back transitions and Material 3 Expressive spring physics to test user journeys before writing application code. - Responsive Mobile & Desktop Adaptive Layout Drafting
Switch individual frames between mobile (412×892) and desktop (1280×800) viewports—automatically adapting bottom navigation bars into navigation rails—and link same-named frames as responsive variants in generated prompts. - Zero-Backend Material 3 Expressive Theme & Color Sandbox
Generate full Material 3 color schemes (light/dark, three contrast levels, dynamic color) from a single seed color and toggle global corner radii, typography (Roboto Flex/Serif), and expressive motion parameters in real time.
Features & Benefits
- 33 Hand-Crafted Material 3 Expressive Components
Includes buttons, icon buttons, FABs, extended FABs, FAB menus, split buttons, chips, top app bars, navigation bars/rails, floating toolbars, tabs, search bars, cards, list items, bottom sheets, dialogs, snackbars, pickers, carousels, morphing loading indicators, and wavy progress bars. - 4dp Grid Snapping, Magnetic Fusion & One-Click Tidy
Automatically aligns elements on a 4dp grid, merges adjacent buttons/chips/list items into connected groups with fused inner corner radii, and offers a one-click ‘Tidy’ button that snaps bars to edges and stacks elements on 16dp margins. - Multi-Screen Flow Wiring & Interactive Transition Preview
Supports unlimited scrollable (1x–3x height) mobile and desktop frames with tap/swipe navigation triggers, directional transitions, and interactive state toggles (e.g., button flip states). - Multi-Language, Platform-Aware Prompt Compiler
Translates canvas coordinates, horizontal runs, card grids, stacking layers, and component behavioral notes into clean prompts in English, Chinese, Japanese, or Korean targeting Android or Web platforms, alongside PNG screenshot export. - Official Local MCP Server & Serverless URL Sharing
Includes an `npx -y m3e-canvas` MCP server for local agent workflows, plus serverless sharing that compresses entire project JSON documents via `CompressionStream` directly into URL `#` fragments without backend storage. - 100% Client-Side Privacy & Optional BYOK AI Helper
Runs completely in browser `localStorage` with multi-project management and JSON import/export; optional AI drafting/note-writing connects directly from the browser to OpenAI, Anthropic, Gemini, or DeepSeek using user-supplied keys.
Pros
- Zero-Backend Privacy & Instant Zero-Install Access
Requires no account, database, or server setup—designs persist locally in the browser and share cleanly via compressed URL fragments or local MCP links. - Solves Layout Hallucination in AI-Assisted UI Development
Converts exact spatial groupings, grids, responsive viewport pairs, and per-component interaction notes into unambiguous structural descriptions that LLMs follow far more reliably than ad-hoc text prompts. - Authentic Material 3 Expressive Fidelity & MIT License
Faithfully implements M3E morphing shapes, spring physics, and dynamic color science under a permissive MIT license with zero paywalled features.
Cons
- Prompt & PNG Output Rather Than Direct Production Code Export
Intentionally compiles sketches into structured LLM prompts and JSON/PNG artifacts rather than generating native Jetpack Compose, SwiftUI, or React source code directly. - Desktop-First Full Editor Experience
While accessible on mobile browsers in a constrained single-screen button-only mode, full multi-screen canvas editing, layer management, and keyboard shortcuts require a desktop browser.
Tutorial
None