How can I embed a custom shape library?

27 views
Skip to first unread message

Sonja Van Wyk

unread,
Jun 9, 2025, 6:25:01 AMJun 9
to draw.io Q&A
Good day,

I created a custom shape library and wanted to open it in a diagram to be used as a template.  

When I open the template, the custom library is not loaded.  

Is there a way to embed the shape library instead of opening it every time users open the template file, like one can in Visio?

Kind regards.
Sonja van Wyk

draw.io Q&A

unread,
Jun 28, 2025, 6:32:08 PMJun 28
to draw.io Q&A

Draw.io (diagrams.net) does not currently support embedding a custom shape library directly into a diagram file in the same way that Visio allows master shapes to be embedded into templates. However, there are a few practical workarounds depending on your use case:


Workaround Options 1. Use a Diagram Template with All Shapes Pre-Added
  • Add the key custom shapes from your library directly onto the canvas (even if off-screen).

  • Save the diagram as a template.

  • When users open this diagram, the shapes will be present and copyable.

🛈 This doesn’t auto-populate the shape library panel, but it does ensure the shapes are accessible.

2. Use a Shared Library Hosted via URL
  • Host your custom library .xml file somewhere publicly accessible (e.g., GitHub Pages or a company CDN).

  • Users can load the library via:

    • File > Open Library from > URL

    • Or embed the URL in your draw.io configuration (for Confluence, etc.).

You can even pre-load it by appending the URL parameter:
?libs=yourlibname=https://yourdomain.com/library.xml

3. Use the Desktop App and Store the Library Locally
  • If your users use the desktop app, store the .xml custom library in a shared location and guide them to load it manually once.

  • The app can remember recent custom libraries for quicker access.


🚫 What's Not Currently Supported
  • There's no way to embed a custom library into the .drawio file itself so that it appears in the shape sidebar automatically when opening that file.

  • There's no native support for “Visio-style masters” or “document-sticky libraries.”

Sonja Van Wyk

unread,
Jun 29, 2025, 6:33:49 PMJun 29
to draw.io Q&A
Good day,

Many thanks for your response.  I am testing the users' ability to open the library manually as well as the desktop app.

Will you please provide me with more information regarding the following?

    • Or embed the URL in your draw.io configuration (for Confluence, etc.).  I'm not familiar with the "configuration".  We work in Google Workspace.

You can even pre-load it by appending the URL parameter:
?libs=yourlibname=https://yourdomain.com/library.xml

 Where will I append the URL parameter?  It seems a Google Drive URL doesn't work, so this will not be a solution anyway.

Kind regards.
Sonja
Reply all
Reply to author
Forward
0 new messages