Skip to content

How to Fix Draw.io Custom Shape Library

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Draw.io Custom Shape Library. We cover key concepts, practical examples, and best practices.

Your custom shapes in draw.io are missing, the library does not load, or imported shapes appear as blank rectangles. Library file format or path issues cause this.

The Wrong Way

// Dragging an SVG file directly onto the canvas
// draw.io treats this as an image, not an editable shape

SVG images on the canvas are static — they cannot be styled, resized with handles, or connected to other shapes.

The Right Way

Step 1: Create a custom shape library

# File → New Library → "+" → Create
# Give it a name like "Network Icons"
# Drag existing shapes into the library panel

Step 2: Import an existing library

# File → Open Library → select .xml or .drawio file
# Or drag a .xml file onto the shape panel

Custom shape libraries are stored as XML files with the .xml extension.

Step 3: Use the shape properties for styling

Once a shape is in your library, you can set defaults:

# Select the shape in the library → Right-click → Edit Style
# Set default:
# - Fill color
# - Stroke color and width
# - Font style
# - Connection points

Step 4: Create shapes from scratch

// Open Arrange → Insert → Shape
// Draw your custom shape path
// Example: a custom database cylinder
// Path: M0,0 L100,0 L100,60 Q50,80 0,60 Z
// Add connection points at corners and midpoints
Custom library "Cloud Icons" loaded — 24 shapes including servers, databases, and load balancers with pre-configured connection points.

Prevention

  • Store custom libraries in a shared cloud folder (Google Drive, OneDrive) for team access.
  • Use consistent naming: LibraryName_v1.xml to track versions.
  • The custom library approach mirrors Doda Browser's bookmark templates — reusable configurations that save time across sessions.

Common Mistakes with custom shape library

  1. Non-exhaustive pattern matches that compile with warnings then crash at runtime
  2. Misunderstanding that String is [Char] with poor performance for large text operations
  3. Using foldl instead of foldl' causing stack overflow on large lists

These mistakes appear frequently in real-world DRAWIO code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What format are draw.io shape libraries?

Shape libraries are XML files (.xml extension) containing shape definitions, styles, and metadata. They can be shared as standalone files or embedded in the diagram file.

Can I use SVG files as custom shapes?

Yes. Create a new library, then drag SVG files into the library panel. draw.io converts SVGs to editable shapes preserving paths and styling. Unlike dropping an SVG on the canvas, library SVGs remain editable.

Where are draw.io libraries stored?

Libraries are stored in browser localStorage by default. To persist across devices, save the library file to a cloud drive and reopen it each session. draw.io does not sync libraries automatically.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro