PadCodedocs

The canvas

Select, move, arrange and delete views on the canvas, zoom in and out, and choose the device and appearance you design on.

The canvas is the middle of the Builder: the screen you're working on, inside an iPhone or iPad, the way your app will look. It's where you select views, move them around and see every change as you make it.

Nothing runs on the canvas: buttons don't press, and variables show their starting values. To try your app, use Preview.

A Button selected on the canvas, outlined, with its settings in the Inspector.

#Select a view

Tap a view to select it. It gets an outline, and the Inspector on the right shows its settings.

  • A container, like a Column or a Row, has a dashed outline and its name on a tag at the top. To select one, tap a gap inside it, between or around its views. You can also pick it in Layers, or select a view inside it and press ← on a keyboard (Select What It's In).
  • Nothing: tap the empty canvas around the device, or press esc. The Inspector then shows the screen's own settings. See Screens.
  • A hidden view, one whose Show when is false right now, is faded on the canvas, so you can still select it.
  • A Repeater, selected, is outlined around its first copy. Tap a view in any copy to select that view; a change to it shows in every copy.

With a keyboard, the arrow keys move the selection: ↑ and ↓ to the view before or after, ← to the container it's in, → to the first view inside it.

#Select several views

With a keyboard attached, hold Shift and tap views on the canvas, or rows in Layers, to add them to the selection or take them out. ⌘A (Select All Beside It) selects the selected view and every view beside it in the same container.

With several views selected, the Inspector shows "N views selected", the list of them, and what you can do to all of them at once: Copy, Cut, Duplicate, Save as Component and Delete. When they all sit in the same container, Group into… puts them in a new Column, Row, Layers or Box, where the first of them was.

#Add a view

Tap a tile in the Library, or drag it onto the canvas. A tapped tile goes inside the selected container, right after the selected view (a Picker or a Menu counts as a view here: what's inside one is its options), or at the end of the screen when nothing is selected. See The Library.

An empty container says Drop components here: drop a tile on it to fill it.

#Move a view

Touch and hold a view, then drag it. As you drag over other views, a line shows where it will land:

  • Above or below the view under your finger (left or right of it, inside a Row or anything else that lines views up side by side), depending on which half of it you're over. On a container, that's only near its edges.
  • Inside a container, when you're over its middle. The container lights up.

Let go to drop it there. Dragging one of several selected views moves them all.

  • A container moves by the tag on its outline: select it, then drag the tag.
  • Inside a Layers (the component that stacks views on top of each other), a selected view moves freely instead: drag it, and it stays where you let go. The move is kept as its Offset, in the Style tab.
  • One step at a time: Move Up and Move Down in the ⋯ menu, or ⌥⌘[ and ⌥⌘].

You can also drag rows in Layers, which is easier for views inside views.

#The ⋯ menu

Select a view and tap ⋯ (Arrange) at the top of the Inspector. The same menu is on the selected row in Layers.

The ⋯ menu of a selected Button: Rename, Copy, Cut, Paste, Duplicate, Save as Component…, Wrap in, Move Up, Move Down and Delete.
ItemWhat it doesShortcut
RenamePuts the cursor in the view's name, at the top of the Inspector (or in its row in Layers). A name makes the view easy to find in Layers. Clear it to go back to the component's name.
CopyCopies the view, and everything in it.⌘C
CutCopies the view, then deletes it.⌘X
PasteAdds what you copied where a tapped tile would go: inside the selected container, or right after the selected view. Dimmed until you've copied something.⌘V
DuplicatePuts a copy right after the view.⌘D
Save as Component…Saves the view to My Components, to reuse in any app. See My Components.⇧⌘S
Wrap inPuts the view inside a new Column, Row, Layers, Scroll Area, Box or Group, where the view was.⌘G (Column), ⌥⌘G (Row)
UnwrapTakes the views out of a container and removes the container. Only for containers.⇧⌘G
Move UpMoves the view one place earlier in its container.⌥⌘[
Move DownMoves the view one place later in its container.⌥⌘]
DeleteDeletes the view and everything in it. Undo brings it back.⌘⌫

When the selected view is part of a selection of several, Copy, Cut, Duplicate, Save as Component… and Delete act on all of them.

The outermost view of a screen, the one everything else is inside, can't be copied, moved or deleted: its menu has only Rename, Paste, Wrap in and, when it holds a single view, Unwrap.

#Delete a view

Three ways:

  • ⋯ → Delete.
  • Press ⌘⌫ (Command-Delete). Delete on its own doesn't remove a view, so a stray key press can't.
  • Drag the view off the device and onto the empty canvas. Release to delete appears; let go, then tap Delete to confirm.
Dragging a view off the device asks Delete “Title”? Undo brings it back.

#Undo and redo

Undo and Redo are the curved arrows at the left of the toolbar, or ⌘Z and ⇧⌘Z. Undo takes back changes one at a time: adding, moving, deleting, and changes to settings, variables and screens.

#Zoom and pan

The zoom menu in the toolbar shows the zoom now, like 100%. At 100% the whole device fits on the canvas.

The zoom menu: Zoom to Fit, then 25% to 400%.
ToDo this
Zoom in or outPinch on the canvas: it zooms around your fingers. Or choose a size in the zoom menu, from 25% to 400%. Or press ⌘= and ⌘-.
Go back to the whole deviceChoose Zoom to Fit in the zoom menu. It also puts the device back in the middle.
Move aroundDrag the empty canvas around the device, or use two fingers (or a trackpad) anywhere.
The canvas zoomed in, close up on the screen's title.

#Device, rotation and appearance

The toolbar buttons next to undo change how the canvas shows your app. They don't change the app itself.

ButtonWhat it does
iPhone · iPadThe device you design on. iPhone has an iPhone 18 Pro's screen. iPad has an 11-inch iPad Air's screen, held sideways.
RotateTurns the device sideways, and back. Its label says which way: Turn to landscape or Turn to portrait.
Appearance (sun or moon)Shows your app in light or dark mode, as an iPad set that way would. It starts the way PadCode itself looks, and Preview opens the same way.
The canvas as an iPad: a wide, landscape screen.
The canvas turned sideways: the iPhone held in landscape.
The canvas in light mode: the app's screen is white.

A screen whose Appearance is set to Dark or Light keeps it, whatever the canvas shows. See Screens.

While the Inspector's Actions tab is open, these buttons make way for the Simple · Flow switch. In a narrow window they're in the toolbar's ⋯ menu. See A tour of the editor.

#Apple Pencil

An Apple Pencil taps, holds and drags on the canvas like a finger, only more precisely. Double-tap (Apple Pencil Pro and 2nd generation) undoes, squeeze (Apple Pencil Pro) opens Quick Actions at the Pencil's tip, and hovering outlines the view a tap would select. You can change what double-tap and squeeze do, and let only the Pencil select, in Settings › Apple Pencil. See Apple Pencil.

#Keyboard shortcuts

Most shortcuts on this page need the canvas to have the keyboard: tap the canvas or select something first. While you're typing in a field, keys type. ⌘/ lists them all; see Keyboard shortcuts.

#See also