Skip to content

Tidy up a diagram: align, style, group and layers

A tidy diagram is easier to read: shapes in line, the same look for the same kind of element, and nothing in the way. You do most of this in the format panel on the right of the drawing editor and in the Arrange menu. Select the shapes first; the format panel then shows the Style, Text and Arrange tabs for them. This article covers colours and text, copying a style, aligning and spacing, sizes, grouping, front and back, locking, layers, and tooltips. The panels and menus are described in The drawing editor: menus, panels and toolbar.

  • You need access to Diagrams; see Get access to Diagrams.
  • Open the diagram on the diagram page; see Create and edit a diagram.
  • To select several shapes, Ctrl+A selects everything; Ctrl+Shift+I selects all shapes and Ctrl+Shift+E all connectors.
  1. Select one or more shapes.
  2. On the Style tab, choose a colour from the palette to set the fill and the outline in one go, or set the fill colour and the line colour separately. Untick the fill for a transparent shape. Here you also set the line pattern and thickness, the opacity, rounded corners, a shadow and a hand-drawn look. The fill colour and line colour buttons on the toolbar do the same.
  3. On the Text tab, set the font, size, colour and alignment of the text (left, centre or right; top, middle or bottom).
  4. To format only part of a text, double-click the shape, select the words, and format them, for example bold or a different colour.
  1. Select the shape whose style you want to reuse, and click the button for copying the style on the Style tab (or press Alt+C).
  2. Select the shapes that should get the same style, and click the button for pasting the style (or press Alt+V). Shape styles and connector styles are copied separately.
  3. To use a style for all new shapes, click the button for making it the default style on the Style tab. To go back to draw.io’s normal style, click on an empty spot so nothing is selected, and click Clear Default Style on the Diagram tab.
  1. Select two or more shapes.
  2. Choose Arrange > Align, and pick the edge or centre to line up on: left, centre or right, or top, middle or bottom.
  3. To give the selected shapes even spacing, choose Arrange > Distribute.
  4. To give shapes the same size, select the shape with the right size and copy its size on the Arrange tab, then select the others and paste the size. Autosize (Ctrl+Shift+Y) fits a shape to its text.
  5. While you drag a shape, it snaps to the grid, and blue guide lines show when it lines up with another shape. To move a shape without snapping, see Alt+drag in Keyboard shortcuts in the drawing editor.
  1. Select the shapes that belong together, for example a shape and its label.
  2. Choose Arrange > Group, or press Ctrl+G. The shapes are now one group.
  3. To select one shape inside the group, Alt+click it. To split the group again, press Ctrl+Shift+U, or use the item for ungrouping in the Arrange menu.
  1. Select the shape.
  2. Choose To Front (Ctrl+Shift+F) to put it in front of everything else, or To Back (Ctrl+Shift+B) to put it behind, for example a coloured background box behind a group of steps. Both are on the toolbar and in the Arrange menu.
  3. To move one shape or group a single step, use Bring Forward or Send Backward in the Arrange menu.
  1. Select the shapes you don’t want to move by mistake, such as a frame or a heading.
  2. Choose Edit > Lock/Unlock, or press Ctrl+L. Locked shapes cannot be moved, changed or connected, and they show a dashed outline.
  3. To unlock, select the shape and choose Lock/Unlock again.

Layers let you keep parts of the drawing apart, for example a background with frames on one layer and the process steps on another. A new diagram has one layer.

  1. Choose View > Layers, or press Ctrl+Shift+L. The layers dialog opens.
  2. In the dialog, add, rename, duplicate, delete or reorder layers. Each layer can be shown or hidden, and locked with the padlock so nothing on it can be changed.
  3. Select a layer before you draw, so new shapes go onto it. To move shapes to another layer, select them and move the selection in the dialog.

Each shape lives on one layer; a connector can join shapes on different layers. The front and back order applies within each layer.

  1. Select the shape.
  2. For a tooltip, choose Edit > Edit Tooltip… (Alt+Shift+T) and type the text that should appear when someone points at the shape.
  3. For your own data, choose Edit > Edit Data… (Ctrl+M), add a property with a name and a value, and confirm. If a shape has no tooltip, its data is shown when someone points at it.
  • Shapes on straight lines with even spacing, the same look for the same kind of element, and locked parts that stay put.
  • After Save Diagram, the tidied diagram in the library.
  • Only common settings are shown. When you select different kinds of shapes, the format panel shows only the settings that fit them all.
  • The grid is not printed. The grid helps you place shapes, but it is not printed or exported.
  • Undo. Ctrl+Z undoes your last change.
  • More shortcuts: Keyboard shortcuts in the drawing editor.