You can easily add shapes already on your canvas to a custom library in draw.io (now diagrams.net) for future use.
Creating a custom library of shapes allows you to reuse frequently used or custom-designed elements across different diagrams. Instead of importing shape files directly in this specific method, you add shapes that you have already placed or created on your drawing canvas into your personal collection.
Based on the provided reference, there are two primary ways to add existing shapes from your draw.io canvas to a custom library:
Method 1: Drag and Drop
This is a straightforward visual method:
- Select the shape(s) on your drawing canvas that you want to add to your library. You can select a single shape, multiple individual shapes, or even a group of shapes.
- Drag the selected shape(s) directly from the drawing canvas area onto the panel where your custom library is displayed.
- Drop the shape(s) into your custom library. They will appear there as new entries.
Method 2: Using the Plus Icon
This method involves selecting the shapes first and then using a dedicated button:
- Select the shape(s) on your drawing canvas. Just like with dragging, you can select single shapes, multiple shapes, or a group.
- Navigate to the header or title area of your custom library in the shape panel.
- Click the plus icon (
+
) located to the right of your custom library's name. - The selected shape(s) will be added to that custom library.
Method | Action on Canvas | Action on Library Panel | Supports Multiple/Group Selection |
---|---|---|---|
Drag & Drop | Select Shape(s) | Drag & Drop into Library | Yes |
Plus Icon | Select Shape(s) | Click + next to Library Name |
Yes |
Both methods effectively allow you to populate your custom libraries with shapes you've used or created on your canvas, making them readily available for drag-and-drop into future diagrams.