Supported URL parameters
The draw.io editor supports a range of URL parameters that control the editor's appearance, behaviour, storage integrations, and modes. These parameters are applied in the order described below and can be combined to customise the editor for different use cases.
For example, to open the editor with German localisation, the Sketch theme, and the format panel disabled:
https://app.diagrams.net/?lang=de&ui=sketch&format=0
Language and localisation
lang=xy: Specifies the language of the user interface. Possible values forxyinclude:
| Code | Language | Code | Language |
|---|---|---|---|
id | Bahasa Indonesia | ro | Română |
ms | Bahasa Melayu | fi | Suomi |
bs | Bosanski | sv | Svenska |
ca | Català | vi | Tiếng Việt |
cs | Čeština | tr | Türkçe |
da | Dansk | el | Ελληνικά |
de | Deutsch | ru | Русский |
et | Eesti | sr | Српски |
en | English | uk | Українська |
es | Español | he | עברית |
fil | Filipino | ar | العربية |
fr | Français | th | ไทย |
it | Italiano | ta | தமிழ் |
hu | Magyar | ko | 한국어 |
nl | Nederlands | ja | 日本語 |
no | Norsk | zh | 中文(中国) |
pl | Polski | zh-tw | 中文(台灣) |
pt-br | Português (Brasil) | ||
pt | Português (Portugal) |
diagram-language=xy: Sets the language used for diagram content, separate from the UI language.translate-diagram=1: Enables diagram content translation.browser-translate=0: Disables mirroring of diagram text into a hidden HTML container for browser translation features (e.g. Chrome Translate). This is enabled by default.
Shape libraries
-
libs=key1;key2;...;keyN: Specifies the current shape libraries to display. Possible keys areallied_telesis,android,archimate,archimate3,arrows2,atlassian,aws3,aws3d,aws4,azure,basic,bootstrap,bpmn,cabinets,cisco,cisco_safe,citrix,clipart,dfd,eip,electrical,er,floorplan,flowchart,gcp2,general,gmdl,ibm,images,infographic,ios,lean_mapping,mockups,mscae,network,office,pid,rack,signs,sitemap,sysml,uml,veeam, andwebicons. -
clibs=key1;key2;key;...;keyN: Specifies custom libraries. Keys are file IDs or URLs with a U-prefix. -
search-shapes=value: Starts with the given value in the search shapes box.
Viewport and page
viewbox={"x": int, "y": int, "width": int, "height": int}: Sets the initial viewport when you specify file IDs.page=index: Starts with the given page. The default is the first page, where the index for the first page is0.page-id=ID: Starts with the given page ID. Has precedence over thepageURL parameter. To find the ID of the current page, right-click on the canvas and select Edit Data. The ID is the first entry in this dialog.pages=[0|1]: Enables or disables multi-page support. When set to0, the page tab bar is hidden.hide-pages=1: Hides the controls that allow you to change the current page in lightbox mode.pv=[0|1]: Enables or disables page view. When set, takes precedence over thepageattribute stored in the diagram file, including when switching between pages.sb=0: Starts with scrollbars disabled.ruler=1: Starts with the ruler enabled.grid=[0|1]: Enables or disables the grid. When set, takes precedence over thegridattribute stored in the diagram file, including when switching between pages.border=60: Sets the border width used in lightbox mode. The default is60.tags=json: Sets the tag visibility configuration as a JSON value.
Editor appearance and themes
ui=[kennedy|min|atlas|dark|sketch|simple]: Uses the Default (Kennedy), Minimal, Atlas, or Sketch editor theme, and can set Dark mode or the simple mode.sketch=[0|1]: Disables or enables the sketch style. The default is1for the Sketch theme and0for all other themes.rough=[0|1]: Controls the rough/hand-drawn drawing style for shapes and connectors, independent of thesketchtheme.dark=[0|1|auto]: Disables or enables dark mode in the Sketch, Minimal, and Simple editor themes.autofollows the system preference.high-contrast=1: Enables high contrast mode.contrast=0: Sets the default adaptive colour mode tosimple(disabling auto-contrast).format=0: Disables the format panel on the right.splash=0: Does not show the splash screen.sidebar=0: Hides the sidebar (shape panels).sidebar-entries=large: Makes sidebar entries larger.windows=0: Disables floating windows (format panel, etc.) in the Minimal theme.shape-picker=0: Disables the shape picker popup.zoom=nocss: Disables the CSS zoom preview.touch=1: Forces the touch mode interface.android=[0|1]: Overrides Android device detection. Android tablets are normally auto-detected, but Chrome's Request Desktop Site mode can change the user agent. Useandroid=1to force Android touch behaviour (pan/zoom gestures, virtual keyboard suppression) orandroid=0to disable it.math=0: Disables MathJax mathematical typesetting support.math-output=html: Sets the math typesetting output toHTML-CSS.
Chromeless mode
Chromeless mode provides a read-only viewer for diagrams. Set chrome=0 to enable it.
chrome=0: Uses the chromeless read-only viewer.target=[auto|self|frame|blank]: Opens links in the same window or frame or in a blank window.autois the default, which opens relative links and anchors in the same window in chromeless mode, and all links in a new window in editing mode.highlight=hex: Specifies the highlight colour (with no leading#) for links in chromeless mode.edit=url: Adds a link for the Edit button in chromeless mode. Useedit=_blankto edit the diagram as a new copy.lightbox=1: Uses the lightbox in chromeless mode (larger zoom, no page visible).transparent=1: Uses a transparent background in chromeless mode.nav=1: Enables folding in chromeless mode.layers=1: Adds layer control in chromeless mode.layer-ids=id1 id2...: Space-separated list of layer IDs to show. If not specified, all layers are shown.link-icons=1: Shows a small overlay icon on cells that have a link, making them easier to discover in the lightbox. Equivalent to theshow-link-iconskey in thedata-mxgraphJSON for HTML embeds and to theshowLinkIconsEditor.configureflag.tooltip-icons=1: Shows a small overlay icon on cells that have a tooltip. Equivalent to theshow-tooltip-iconskey in thedata-mxgraphJSON for HTML embeds and to theshowTooltipIconsEditor.configureflag.tooltips=0: Suppresses cell tooltips in the chromeless viewer, which otherwise expose a cell's link and custom attributes (such aslinkTarget) on hover. Intended for embed, inline, and viewer hosts. Applied both at the tooltip handler and at the content level, so it holds regardless of the handler state.close=1: Shows the Close button in chromeless mode, which closes the window when selected.toolbar=0: Disables the toolbar in chromeless mode.toolbar-config=json: Configures toolbar buttons in chromeless mode as a URL-encoded JSON value.noPrint=1: Hides the print button in the chromeless toolbar.noExport=1: Hides the image export button in the chromeless toolbar.
File and diagram management
open=prefix+ID: If location hash properties are not available, use this as a replacement. The browser will add the hash property to the URL immediately and not remove the URL parameter. An existing hash property takes precedence.data=xml: Provides diagram XML data directly in the URL.rev=id: Selects a specific revision of a Google Drive or Dropbox file.title=title: Sets a new file title. Used with thecreateandurlparameters.notitle=1: Uses the default filename for new files. Used with theurlparameter.template-filename=name: If the#Uhash property is used but the URL does not contain a filename to determine binary mode. See the list of supported location hash properties.drafts=0: Disables draft states (does not save unsaved files in IndexedDB).nowarn=1: Suppresses the warning before an unload for local files.svg-warning=0: Suppresses the warning for old viewers in SVG export.rt=1: Uses chromeless mode with Google Drive realtime enabled.override-mime=1: Saves all Google Drive files asapplication/vnd.jgraph.mxfile.openInSameWin=1: Opens files in the same window instead of new tabs.
Creating diagrams from templates
The create parameter allows you to create a new diagram from a template URL, data, or message. It can be passed as either a URL query parameter or a hash property:
- URL parameter (
?create=value): The value is sent to the server as part of the request URL. Suitable for short values such as template URLs. - Hash property (
#create=value): The value after the#is never sent to the server — it stays entirely in the browser. This makes it more suitable for longer values and for cases where the diagram data should remain private.
For the largest payloads and maximum privacy, use the postMessage approach described below, which avoids putting any diagram data into the URL at all.
Value formats
-
create=url: Creates a new file from a template URL. If the value is not a URL and is not empty, the script will try to usewindow.opener[url]. In embed mode,window.opener[name]will be used to get the initial XML. Note that this requires the same origin policy in the opener/parent for reading the variable. -
create={json}: If the value starts with a{, it is treated as a JSON object using the format{type: 'type', data: 'data'}. An optionalcompressedargument can betrueif the data is compressed. For a worked example of constructing the#createURL and compressing thedatawith pako, see the tool for generating a diagram and compressing the data with pako. The supported types are:
| Type | Description |
|---|---|
xml | Standard draw.io XML diagram data. |
csv | CSV data that is imported using the CSV import descriptor format. |
mermaid | Mermaid diagram syntax that is converted to a draw.io diagram (example). |
generate | A natural language text prompt that is sent to an AI model to generate a diagram. The data value is the prompt text describing the diagram to create. |
message | Signals that the diagram data will be provided via postMessage instead of in the URL. See Using postMessage for large data below. |
Running a layout on the created diagram
The JSON object accepts an optional layout field to run a layout on the diagram after it is created. This works for every type and is useful when the supplied diagram has no meaningful coordinates and you want draw.io to position the shapes. The layout value is either a preset name or a custom-layout array:
-
Preset name — one of
verticalFlow,horizontalFlow,verticalTree,horizontalTree,radialTree, ororganic(the same presets as the Arrange > Layout menu):{"type": "xml", "data": "<mxGraphModel>...</mxGraphModel>", "layout": "verticalFlow"} -
Custom-layout array — the full JSON layout specification, which supports layout sequences and per-layout options (it can also be passed as a JSON string starting with
[):{"type": "xml", "data": "<mxGraphModel>...</mxGraphModel>", "layout": [{"layout": "elkLayered", "config": {"elk.direction": "RIGHT"}}]}
The same layout value is accepted by the embed protocol's load action and the desktop --layout command-line flag. After the layout runs, the editor updates the #create hash to the laid-out XML and removes the layout field, so reloading reproduces the result without running the layout again.
Using postMessage for large data
For large diagrams or when privacy is important, use type: 'message' to send the data via postMessage instead of encoding it in the URL. The iframe sends a message with event ready when it is ready to receive the data, and the parent/opener responds with action create and the data in the same format as described above. Since the diagram data is exchanged directly between the parent window and the iframe, it never appears in the URL and is not subject to URL length limits.
iframe.src = 'https://www.draw.io/#create=%7B%22type%22%3A%22message%22%7D';
// For lightbox use 'https://www.draw.io/?lightbox=1&dark=auto&border=10&edit=_blank#create=%7B%22type%22%3A%22message%22%7D';
window.addEventListener('message', function(event)
{
if (JSON.parse(event.data).event === 'ready')
{
event.source.postMessage({action: 'create', data: createObj}, '*');
}
});
The three approaches in order of increasing payload capacity and privacy:
| Approach | Data in URL | Sent to server | Max data size |
|---|---|---|---|
URL parameter (?create=...) | Yes | Yes | Limited by URL length |
Hash property (#create=...) | Yes (after #) | No | Limited by URL length |
postMessage | No | No | Unlimited |
AI diagram generation
smart-template=value: Triggers AI-generated diagram creation from a text prompt. The value is a URL-encoded text description of the diagram to generate.
Plugins
plugins=0: Does not load plugins.p=id1;id2;...;idN: Selects which plugins to load. See the list of available plugins.
Integration parameters
picker=0/1: Disables or enables the Google file picker in dialogs.thumb=0: Disables the creation of thumbnails in Drive.gitlab=url: Sets the URL-encoded path to a custom GitLab installation to use for GitLab file operations.gitlab-id=ID: Specifies the client ID of the custom GitLab application when using a custom GitLab instance.vars=json: Uses a URI-encoded JSON string for global placeholders for use in labels and tooltips where enabled, e.g.vars={"key":"value"}.base=url: Sets the base URL to use for links. Use this ifdocument.referreris not available in embed mode.
Storage modes
local=1: Uses device mode only.storage=device: Adds a device storage option for touch devices.noDevice=1: Hides the device/local file options in dialogs.browser=0/1: Disables local storage as a storage location (0) or shows the browser option in the storage dialog (1).save=local/remote: Enables or disables saving files locally. The default islocal. If disabled, files are echoed via a servlet for a local save.mode=[google|onedrive|github|dropbox|gitlab|device|browser|trello]: Switches to the specified storage mode.
Cloud integration toggles
gapi=0: Disables the Google integration.db=0: Disables the Dropbox integration.od=0: Disables the OneDrive integration.ms365=0: Disables the Microsoft 365 integration.tr=0: Disables the Trello integration.gh=0: Disables the GitHub integration.gl=0: Disables the GitLab integration.drive=0: Simulates app.diagrams.net regardless of the domain name (uses the old app ID).
Collaboration and sync
sync=[none|manual|auto]: Enables or disables collaborative editing. The default isauto.
Special modes
offline=[1|0]: Registers or unregisters the progressive web app. All remote storage locations are disabled when offline.pwa=0: Disables the ability to register or unregister the progressive web app. When installed, it will stay installed.stealth=1: Disables all features that require external web services (such as PDF export).gapi-stealth=1: Disables all features that require external web services except Google Drive (such as PDF export).lockdown=1: Disables all data transmission apart from directly between the browser and the selected data storage location. See data governance lockdown.demo=1: Shortcut fordb=0&gapi=0&math=0&picker=0. Disables the splash screen and creates an empty, local diagram file.
Embed and client modes
embed=1: Runs diagrams.net in embed mode. Use this mode with embed.diagrams.net only.embedInline=1: Enables inline embed mode. Automatically setsembed=1,ui=sketch,plugins=0,proto=json, andprefetchFonts=1.configure=1: Sends theconfigureevent and waits for theconfigureaction. See more about embed mode.proto=json: Enables the JSON protocol forpostMessagecommunication in embed and client modes. See the JSON protocol in embed mode.client=1: Runs diagrams.net in client mode. This displays a normal UI and sends areadymessage to the opener or parent when the page is loaded. After receiving a message containing XML or compressed XML, a local file is created. The file is then set tomodifiedso the connection to the window can be closed after sending the initial XML. Whether the XML is loaded again after a page refresh depends on the caller implementation. Useproto=jsonto use a custom protocol for special cases.suppressNewWindows=1: Routes link clicks and popups through the embedding host instead of opening new browser windows or tabs (forcespopupsAllowedoff): link clicks are reported via theopenLinkevent and the "open in new window/tab" options are hidden. Intended for sandboxed embed and inline hosts such as a VS Code webview. Also settable as thesuppressNewWindowsEditor.configureflag — see embed mode.
Deprecated parameters
url=url: Deprecated — Use the#Uhash property (#U{uri_encoded_url}) to open a diagram from a URI-encoded URL, e.g.https://app.diagrams.net/#Uhttps%3A%2F%2Fraw.githubusercontent.com%2Fjgraph%2Fdrawio-diagrams%2Fmaster%2Fdiagrams%2Fschema.xmldesc={compressed-json}: Passes the CSV import descriptor (example). Works with the www.draw.io domain only.
Additional resources
- The protocol used in embed mode
- Parameters for embedding HTML. Note that URL parameters can also be passed as a URL-encoded JSON string via a
#P...URL hash. - Tool for encoding and decoding URL parameters