Skip to main content

Advanced layout shapes and layout containers

· 3 min read

The advanced shape library contains several automatic layout shapes that let you quickly build flowcharts, trees and mindmaps without needing to worry about manually rearranging shapes.
Hold down alt as you click on shapes in the shape library to add and connect them inside a automatic flow layout shape

Add an advanced layout shape

Advanced shape library: Click on More Shapes at the bottom of the left panel, select the General shape library, and click Apply.

The layout shapes in the Advanced shape library include vertical and horizontal trees, vertical and horizontal flows, mindmaps and org charts. The Tree Container, mindmap and org chart layout shapes have expand/collapse functions in the top left of their shapes.
The Advanced shape library contains a number of automatic layout shapes surrounded by a swimlane shape

Add more shapes to your layout shape

The diagram inside the layout shape will automatically rearrange to fit any new connected shape that you add or delete. Be careful not to delete all of the shapes inside though - when you delete the last contained shape, the entire layout shape is also deleted.

  • Drag and drop a shape from the shape library onto one of the direction arrows of the shapes inside the layout shape.
  • Hold Alt and click on a shape in the shape library to automatically add and connect it to the selected shape inside the layout shape as in the example at the top of the page. This selection will move on to the newly added shape, so you can quickly build your diagram inside the layout shape.
  • In the tree layout shapes, click on the left and right direction arrows to quickl add sibling nodes and connect it to the same parent node.
    Click on the directional arrows that appear when you hover over a shape to clone and connect a new shape inside of a container layout shape

Insert a layout container

While the layout shapes from the Advanced shape library are surrounded via a swimlane shape that you can connect to and from, when you insert a layout container via Arrange > Insert > Layout or via the toolbar + > Layout it will have an invisible/transparent border.
Quickly click together a horizontal flow in draw.io

Note: You can not connect to the border of these layout containers, only to the shapes inside.

The layout algorithms for both the Advanced layout shapes and these layout containers is the same. Add and remove shapes just as you would one of the Advanced layout shapes. Similarly, when you delete the last remaining shape inside a layout container, the layout container itself will also be deleted.

Do diagram layouts apply to layout containers?

No. If your diagram has layout containers (from the Advanced shape library or via Arrange > Insert > Layout), the shapes and connectors inside those layout containers will not be rearranged when you apply a diagram layout from Arrange > Layout. While the layout container shapes follow the same algorithms, they are treated as a single shape when applying a diagram-wide layout.
Rearrange your diagram quickly by applying a layout - select Arrange > Layout from the menu