draw.io

Collapse container to icon (or icon + text heading) in drawio


I am using a container in draw.io and would like to pair the container itself with an icon. The resultant shape will be added to a shared library in order to set some general standards for the look and feel of our software component diagrams.

I would like the container to show the icon and header text when the container is in the collapsed state, but I don't know how to do that. If I group the icon with the container, then the icon is hidden when the shape is collapsed.

Is there some way to add the icon to the "header" of the container?

Behaviour when expanded:

Behaviour when expanded

Desired behavior when collapsed:

Desired behavior when collapsed

Current behavior when collapsed:

Current behavior when collapsed


Solution

  • This is not supported at the moment but there is open discussion related to the topic https://github.com/jgraph/drawio/discussions/2310