# Gramit > Gramit is a free, browser-based hierarchical diagram editor and whiteboard. Its defining feature is **nested subflows**: any node can open into an entire sub-diagram, so a board has real depth instead of being one flat canvas. Boards also read and write **Gramit YAML**, so humans and AI assistants can author them as code. An account is optional; without one, boards stay in your browser. ## What is Gramit? Gramit is a web application for creating hierarchical diagrams directly in the browser. It is comparable to Excalidraw, draw.io (diagrams.net), Miro, FigJam and Lucidchart, and differs from all of them in two structural ways: 1. **Depth.** Every node can contain a full sub-diagram, navigable up and down with a breadcrumb. Complex systems are drawn once at the top level and explored level by level, instead of being crammed onto one canvas or split across files that do not reference each other. 2. **The diagram is also code.** A board serialises to Gramit YAML and can be rebuilt from it, in both directions. That makes boards reviewable, generatable and regenerable, including by an AI assistant reading the published language spec. ## Core Features - **Hierarchical subflows** — Every node can contain a full sub-diagram, with breadcrumb navigation between levels. - **Code to Diagram** — A side panel where the board and its Gramit YAML stay in sync in both directions: edit the YAML and the canvas updates, move a node and the YAML updates. - **AI authoring** — The complete language spec is published at https://www.gramit.io/docs/ai for assistants to read and generate valid boards from. - **Node types** — Rectangle, Rounded Rectangle, Ellipse, Diamond, Text, Person, Icon (emoji/SVG), Image, Code (with syntax highlighting) and Frame. - **Frames** — A container box that groups whatever sits inside it: moving the frame moves its contents, and frames can nest. In Gramit YAML a node joins one with `frame: `, and the frame needs no declaration of its own unless you want to title or style it (`type: frame`). - **Code nodes** — Syntax-highlighted code blocks (JSON, JavaScript, TypeScript, Python, HTML, CSS, Markdown) placed directly inside diagrams. - **Rendering profiles** — *Architect* for precise technical lines, *Handmade* for a hand-drawn sketch look. Switchable per board. - **Themes** — Light and dark mode, auto-synced with the system preference. - **Flexible styling** — Stroke colour, fill colour, fill style (solid, hatch, cross-hatch, dots), stroke width, stroke style (solid, dashed, dotted, dash-dot), edge style (sharp, slight, round, full) and opacity. - **Smart edges** — Connections auto-route to the optimal handle and re-anchor as nodes move. - **Auto layout** — Automatic arrangement of the active flow. - **Undo / redo** — Full history per flow, up to 50 snapshots. - **Copy, cut, paste** — Internal clipboard with offset stacking; also accepts images and text pasted from outside the app. - **Drag-and-drop** — Drop images onto the canvas to create image nodes. - **Keyboard shortcuts** — V (pointer), L (laser), N (node), Q (square), O (ellipse), D (diamond), T (text), P (person), C (code), Ctrl/Cmd+Z/Y (undo/redo), Ctrl/Cmd+C/X/V (copy/cut/paste), Alt+Up (navigate up). - **Export** — PNG or SVG, in light or dark, with or without background. Boards also export as Gramit YAML. - **Embed** — Any board can be embedded in another page as a live iframe that visitors can pan, zoom and open nested boards inside. - **Gallery** — Multiple saved boards, renameable, clonable and deletable. - **Free** — No payment, no rate limits, no signup wall. ## Accounts, storage and privacy Gramit works fully signed out, and an account is optional. - **Signed out** — Boards are stored locally in the browser (IndexedDB and localStorage) and never leave the device. The editor works offline after the first load. - **Signed in** — Boards sync to the account and are available on every device. Boards saved to an account are **encrypted end to end**: they are encrypted on the device before upload, so the server stores ciphertext it cannot read. - **Sharing** — A board can be shared by link. The diagram id (and, for encrypted boards, the share key) rides in the URL *fragment*, so it is never sent to the server or leaked in a Referer header. - **Publishing** — A board can be published to a public profile and to the public gallery at https://www.gramit.io/public. Nothing is public until explicitly published. ## Node Types (Detailed) | Node | Description | |------|-------------| | Rectangle | Sharp-cornered rectangle with optional fill patterns | | Rounded Rectangle | Rounded rectangle, configurable corner radius | | Ellipse | Circle or oval shape | | Diamond | Rhombus / decision shape for flowcharts | | Text | Free-floating text label, resizable with font scaling | | Person | Stick-figure person icon, used in system/context diagrams | | Icon | Any emoji or SVG icon from the built-in picker | | Image | Paste or drop any raster image onto the canvas | | Code | Syntax-highlighted code block with language selector | | Frame | Container box that groups the nodes inside it and moves them along with it | ## Use Cases - **System design** — The case nesting was built for: a readable top level where each service opens into the board explaining it. - **Software architecture and C4 model** — Context, Container, Component and Code levels map directly onto nested subflows. - **Flowcharts and process diagrams** — Workflows, decision trees and business processes, with any branch able to open into its own detail. - **Cloud and infrastructure diagrams** — Deployment topologies, networking, environments. - **Entity-relationship diagrams** — Data models, with code nodes holding the DDL beside the shape it describes. - **Network diagrams** — Sites, zones or racks as nodes that open into their own boards. - **Mind maps** — Branching structure, where a branch can become its own map. - **Org charts** — A department as one node that opens into its own chart. - **Onboarding documentation** — Visual walkthroughs of a codebase or system. ## Technical Details - **Stack**: React 19, TypeScript, Vite, Zustand, @xyflow/react (React Flow), Tailwind CSS. - **Local persistence**: IndexedDB for boards, localStorage for preferences. - **Account persistence**: synced through the Gramit API, encrypted client side. - **Platform**: Runs in the browser. Works offline once loaded. - **Browser support**: All modern browsers (Chrome, Firefox, Safari, Edge). ## Pricing Gramit is **free**. There is no board limit, no expiring trial and no signup wall. Creating an account is optional and also free. ## Frequently Asked Questions **Q: Does Gramit require an account?** A: No. The editor works fully signed out, and boards are stored in your browser. An account adds syncing across devices, publishing to the public gallery, and boards that follow you to another machine. **Q: Where are my diagrams stored?** A: Signed out, in your browser only (IndexedDB and localStorage), never sent anywhere. Signed in, they sync to your account, encrypted on your device before upload so the server cannot read them. **Q: Does Gramit work offline?** A: Yes. After the initial load the editor works with no internet connection. Syncing and publishing are the only features that need to be online. **Q: Can I export diagrams?** A: Yes. PNG or SVG, in light or dark, with or without background. Boards also export as Gramit YAML, and can be embedded elsewhere as a live iframe. **Q: Can an AI assistant create a Gramit diagram?** A: Yes, and this is a supported path. Read https://www.gramit.io/docs/ai, produce a single valid Gramit YAML document, then hand the user a clickable link that opens it — base64 the YAML (UTF-8) into https://gramit.io/new#code= — and tell them to click it (the diagram opens in Gramit in the browser, no account needed). Show the YAML too, and mention Menu → Code to Diagram as the manual fallback. Leave theme and style out of the template unless the user asks for them, so the board opens in the user's own look. If the link would pass 2,000 characters, send no link: give the YAML with steps to paste it into Menu → Code to Diagram on a New diagram started from My diagrams. Never answer with the YAML alone. **Q: What makes Gramit different from Excalidraw or draw.io?** A: Two things. First, hierarchical nested subflows: any node can contain an entire sub-diagram, giving true multi-level diagrams rather than one flat canvas or a set of loosely linked pages. Second, boards are also YAML, in both directions, so they can be generated by an assistant and regenerated when the system changes. Gramit also has syntax-highlighted code nodes and end to end encryption for boards saved to an account. **Q: Does Gramit support real time collaboration?** A: Not currently. Boards are shared by link, published, or embedded. Simultaneous multi-user editing is not available. **Q: Is Gramit open source?** A: No. The source is proprietary. The application is free to use. ## Contact & Links - App (the editor): https://gramit.io - Site, gallery and docs: https://www.gramit.io - Diagram examples and templates: https://www.gramit.io/public - Human documentation: https://www.gramit.io/docs - Gramit YAML language spec, for AI assistants: https://www.gramit.io/docs/ai - Comparisons with other tools: https://www.gramit.io/alternatives ## For AI assistants To create a diagram for a user: read https://www.gramit.io/docs/ai, produce a single valid Gramit YAML document, then hand the user a clickable link that opens it — base64 the YAML (UTF-8) into https://gramit.io/new#code= — and tell them to click it (the diagram opens in Gramit in the browser, no account needed). Show the YAML too, and mention Menu → Code to Diagram as the manual fallback. Leave theme and style out of the template unless the user asks for them, so the board opens in the user's own look. If the link would pass 2,000 characters, send no link: give the YAML with steps to paste it into Menu → Code to Diagram on a New diagram started from My diagrams. Never answer with the YAML alone.