Shapes, selection and transforms
Drawing a shape, selecting one or several, and moving, resizing, turning, copying and stacking them. Trying each, we fixed three things: a new shape is now selected, the arrow keys move it, and a typed angle turns it in place.

Most of a screen is made of a handful of shapes: rectangles for boxes and buttons, circles for avatars and dots, lines for rules, and text. This article covers drawing them and the things you do to them afterwards. Text has an article of its own.
We drew a 640 by 400 frame on an empty part of the Starter app sample's canvas and worked in it, without saving.
Drawing
Pick a tool from the rail, or press its key, and drag on the canvas:
| Tool | Key | Hold Shift to… |
|---|---|---|
| Rectangle | R | draw a square |
| Ellipse | O | draw a circle |
| Triangle | keep it as wide as it is tall | |
| Line | L | keep it horizontal, vertical or at 45° |
| Pen | P | |
| Pencil | N |
A click without dragging gives you a shape of a standard size (a rectangle is 120 by 80), centred where you clicked. We drew a rectangle, a circle, a triangle and a line, and named them in Properties:

New: the shape you've just drawn is selected, and the Select tool is back. Before, the tool stayed on and nothing was selected, so to colour or name the shape you'd just drawn you had to press V and click it first. Now you can go straight to Properties. To draw several of the same shape, press the key again.
Selecting
- Click a shape to select it.
- Shift-click, Ctrl-click or ⌘-click adds a shape to the selection, or takes it out. All three work, so whichever your hands know is the right one.
- Drag a box around shapes. Starting inside a frame, the box selects what's inside it.
- Double-click reaches the top-most shape under the pointer, even inside a frame that's inside a frame.
- Right-click → Select layer lists everything under the pointer, for a shape buried under others.
We dragged a box across the whole frame:

With several selected, Properties offers ways to line them up. That's the next article.
Moving
Drag the shape, or type its X and Y. Positions count from the top left of the canvas, not from the frame.
New: the arrow keys move the selection one pixel at a time, or ten with Shift. Each press is a single step of undo. Before this, the only way to move a shape a little was to drag it and hope, or to retype its X.
Resizing
Drag a handle, or type W and H. The corner handles resize freely; hold Shift to keep the proportions.
Turning
Drag the small circle above the selection, or type an angle in Rotation. We turned the triangle 90° so it points right:

Fixed: a typed angle turns the shape about its centre. The handle always did. The Rotation field turned it about its top-left corner instead, so typing 90 swung our triangle to the left and on top of the circle. Both now agree, and the shape stays where you put it.
Frames don't turn. Right-click → Flip horizontal and Flip vertical mirror a shape.
Copying
Ctrl+D (⌘D on a Mac) duplicates the selection. The copy lands 16 pixels down and to the right, so you can see it, and it's selected, so you can drag it straight to where it goes:

Delete or Backspace removes the selection.
Stacking
Shapes later in the list are drawn on top. To change the order, right-click:
| Command | Key |
|---|---|
| Bring to front | Ctrl+Shift+] |
| Bring forward | Ctrl+] |
| Send backward | Ctrl+[ |
| Send to back | Ctrl+Shift+[ |
The same menu is on a row in Layers, whose order is the order of the drawing.
Lock (the padlock in Layers, or right-click) stops a shape being picked or moved on the canvas by accident. You can still select it from its row in Layers, to unlock it, and the arrow keys leave it where it is.
The shapes, as the drawing stores them
Each shape is a node, and every number in Properties is a field on it. The four shapes above, trimmed to what matters:
[
{ "type": "rect", "name": "Card", "x": 40, "y": 40, "width": 120, "height": 80,
"fill": "token:color.primary", "cornerRadius": 8, "rotation": 0 },
{ "type": "ellipse", "name": "Dot", "x": 200, "y": 40, "width": 80, "height": 80, "fill": "token:color.primary" },
{ "type": "path", "name": "Arrow", "x": 320, "y": 40, "width": 80, "height": 80, "rotation": 90 },
{ "type": "line", "name": "Rule", "x": 40, "y": 200, "width": 360, "height": 0,
"stroke": "token:color.border", "strokeWidth": 2 }
]
Every node also carries visible, locked and zIndex, which are the eye, the padlock and the stacking order. zIndex is why the
order in Layers is the order on the canvas: the higher the number, the later it is drawn, and the more of what is below it covers.
Choosing the right shape
A screen is mostly rectangles and text, but each shape has a job it does best:
| You need | Draw | Notes |
|---|---|---|
| A box, a card, a button's background | Rectangle, with a corner radius | Usually better as a frame, so it can hold its text |
| An avatar, a status dot | Ellipse, with Shift for a circle | An image inside a circle frame makes a round photo |
| A divider, an underline | Line, with Shift | A stroke of 1 or 2 in the border token reads well in both themes |
| An arrow, a chevron, a badge shape | Triangle, Pen or an icon | An icon from the library is usually the quicker route; see Fills, gradients and icons |
| A logo or an illustration | Pen, or an imported image | Keep decoration out of the reading order on the Screen tab |
| A hand-drawn mark | Pencil | Rare on a business screen |
The first row is the one worth pausing on. A rectangle can't contain anything; a frame can. A button made of a frame with a fill and a corner radius holds its label, takes part in auto layout and can be told it is a button on the Screen tab. A rectangle with text laid on top of it is two loose objects that have to be moved together forever.
Precise placement
Dragging is fast; typing is exact. Some habits that make screens line up:
- Type round numbers. X 16, Y 24, W 120. A layout built on multiples of 4 or 8 lines up by itself.
- Use the arrow keys for nudges, a pixel at a time or ten with Shift, rather than dragging a few pixels and hoping.
- Let alignment do the rest. With several shapes selected, the align and distribute commands in Properties are quicker and more exact than placing each by eye. Snapping and alignment covers them.
- Resize from the panel when a shape must match another: type the same W.
Keys, together
| Key | Does |
|---|---|
| R, O, L, P, N, T, F | Rectangle, Ellipse, Line, Pen, Pencil, Text, Frame |
| V | Back to Select |
| Arrow keys | Move 1 px; with Shift, 10 px |
| Ctrl+D | Duplicate |
| Delete, Backspace | Remove |
| Ctrl+] / Ctrl+[ | Forward / backward; add Shift for front / back |
| Ctrl+Z | Undo, one step per nudge or change |
Questions that come up
Why does X count from the canvas and not from the frame? Because a shape can be moved between frames, and a position that changed meaning each time would be confusing. Constraints are what relate a shape to its frame.
Can I lock a whole screen while I work on another? Yes: lock its frame in Layers. Nothing inside can be picked on the canvas by accident until you unlock it.
Try it
Draw a rectangle, an ellipse with Shift, and a line. Select the rectangle and press Shift+→ three times, then Ctrl+Z once. Type 45 in its Rotation. Press Ctrl+D, and send the copy to the back.
Next: snapping and alignment.