Use custom libraries in Confluence Cloud

Custom shape libraries help you save time when you regularly reuse complex or specific shapes in your diagrams.

Create a custom library

  1. Edit a Confluence page, type /draw and select the Draw.io diagram macro to create a new diagram. Alternatively, open an existing diagram in the draw.io editor.
  2. Click File > New Library and select where you want to store your custom library.
    Create a new shape library to use with draw.io for Confluence Cloud
    • Device saves a copy of your library as an .xml file on your device. You will need to load your shape library when you work on a diagram, but this file will not be deleted if you clear your browser data.
  3. Enter a name for your shape library. You can drag image files from your device or image URLs into this dialog to add them directly to your new custom library before you save it, or click Add images to add files saved on your device. Click Save when you are done.
    Save your new custom shape library to your browser or your device

Your new custom shape library appears in the left-hand panel below the scratchpad. You can now drag shapes or selected groups of shapes from the drawing canvas into the shape library.

Edit shapes in your custom shape library

  1. Click the edit pencil icon next to the name of your custom library.
    • Click on the name under a shape and enter a new name.
    • Click the cross in the top right of the shape you want to delete.
  2. Save your custom library when you are done (click Save).
    Rename shapes in a custom library

Export your custom shape library

  1. Click the edit pencil icon next to the name of your custom library.
  2. Click Export.
  3. Enter a new filename if you would like, and choose whether to save your custom library to your device or your browser.
    Export your custom shape library from draw.io

Open an existing custom library

  1. Click File > Open Library from and select the location where your custom library file is stored. Shared custom libraries stored in Confluence Cloud are covered below.
  2. Open the custom library file:
    • Navigate to the file on your device, and click Choose.
    • Click on the linked name of the library stored in your browser.
    • Enter the URL where your library file is available on the internet.

Your custom library will open in the left panel under the scratchpad.

Make a draw.io custom library available in Confluence Cloud

Confluence Cloud administrators can add custom libraries to the draw.io Configuration in the instance’s settings. Users can then load these custom libraries when they work with draw.io.

This is useful when teams need to create diagrams in the same style, or when they need to work with the same shapes or shape groups.

  1. Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
  2. Go to the Custom Libraries tab, then click on Add Library.
    Add a custom library to Confluence Cloud via draw.io Configuration in the Confluence Administration area
  3. Navigate to the custom library file on your device, select it, then click Choose.

Now users can open the shared custom library you just stored in Confluence Cloud.

Note: draw.io users must have the correct permissions set in your Confluence instance to access these custom shape libraries.

Open a shared custom library in draw.io

To open a custom library as a user, first edit or add a new draw.io diagram.

  1. Click File > Open Library from > Confluence Cloud.
    Open a draw.io custom library in Confluence Cloud
  2. Click to enable the checkbox for the custom library (or multiple libraries) you want to open, then click OK.
    Select a draw.io custom library to open in Confluence Cloud

Your custom library appears under the Scratchpad in the left panel.

Custom libraries appear under the scratchpad in Confluence Cloud

Delete a shared custom library from Confluence Cloud

  1. Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
  2. Go to the Custom Libraries tab, click on the cross in the Action column for the library you want to delete.

Set custom default shape libraries

As an administrator, you can also set which shape libraries are opened by default by adding a line to the draw.io configuration.

  1. Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
  2. Edit the JSON code to include the defaultLibraries option and list which libraries you want to open by default.
  3. If you want to have a custom library open by default, add the defaultCustomLibraries option and list the libraries in the same way.
    { "defaultLibraries": "general;uml;entity;",
      "defaultCustomLibraries": ["marketing", "infographics"], }
    
  4. Click Save when you are finished with the draw.io configuration.

Open shape libraries and custom libraries by default in draw.io for Confluence Cloud