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
- 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. - Click File > New Library and select where you want to store your custom library.
- 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.
- Device saves a copy of your library as an
- 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.
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
- 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.
- Save your custom library when you are done (click Save).
Export your custom shape library
- Click the edit pencil icon next to the name of your custom library.
- Click Export.
- Enter a new filename if you would like, and choose whether to save your custom library to your device or your browser.
Open an existing custom library
- 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.
- 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.
- Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
- Go to the Custom Libraries tab, then click on Add Library.
- 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.
- Click File > Open Library from > Confluence Cloud.
- Click to enable the checkbox for the custom library (or multiple libraries) you want to open, then click OK.
Your custom library appears under the Scratchpad in the left panel.
Delete a shared custom library from Confluence Cloud
- Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
- 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.
- Go to the Confluence Settings. In the Atlassian Marketplace section on the left, click on draw.io Configuration.
- Edit the JSON code to include the
defaultLibraries
option and list which libraries you want to open by default. - 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"], }
- Click Save when you are finished with the draw.io configuration.