Skip to content

Language tour

A mockup is a fenced block whose language is mockitdown. The code inside is a declarative subset of Swift and SwiftUI. Every example below uses the neutral Wireframe pack (base). A pack page shows the same notation in a real framework's style.

Anatomy of a block

The fence line carries options — for example mockitdown title="Inbox" device="phone" after the three backticks — and the block body reads:

import SwiftUI                     // selects the pack (optional: fence `pack=` or the site default)
import "shared/kpi"                // custom components from docs/mockups/shared/kpi.mockitdown
@Screen(id: "SCR-1")               // optional metadata; fence attributes override it

NavigationStack { /* … */ }        // the views that make up the screen

Fence attributes: pack, device (phone, phone-landscape, tablet, tablet-portrait, desktop, wide, fit), appearance (light, dark, auto — follows this site's toggle —, both), width, height, chrome, title, id, caption, elements, url, source.

Elements, arguments and modifiers

Elements take positional and labelled arguments, as in SwiftUI. Modifiers chain with a leading dot, on the same line or on the next.

Release notesVersion 2.4 adds offline mode and sync fixes.
Download
InstallLater
Downloading
Elements and modifiers
Source
VStack(alignment: .leading, spacing: 10) {
  Text("Release notes").font(.title2)
  Text("Version **2.4** adds *offline mode* and `sync` fixes.")
    .foregroundStyle(.secondary)
  HStack {
    Label("Download", systemImage: "arrow.down.to.line")
    Spacer()
    Button("Install").buttonStyle(.borderedProminent)
    Button("Later")
  }
  ProgressView("Downloading", value: 0.62)
}
.padding()
.frame(width: 420)

Layout

VStack, HStack, ZStack, Grid/LazyVGrid, ScrollView, Spacer and Divider behave like their SwiftUI namesakes: a stack containing a Spacer takes all the room its parent offers.

Projects
New
AtlasUpdated today
BorealisUpdated today
CirrusUpdated today
DeltaUpdated today
EchoUpdated today
FjordUpdated today
Stacks and grids
Source
VStack(spacing: 12) {
  HStack {
    Text("Projects").font(.headline)
    Spacer()
    Button("New", systemImage: "plus").buttonStyle(.borderedProminent)
  }
  LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())], spacing: 12) {
    ForEach(["Atlas", "Borealis", "Cirrus", "Delta", "Echo", "Fjord"]) { name in
      Card(name, subtitle: "Updated today", systemImage: "folder")
    }
  }
}
.padding()
.frame(width: 640)

Data: let, ForEach, if and interpolation

ALAna LimaDesignOnline
BOBen OkaforEngineeringAway
CWChen WuResearchOnline
3 people
ForEach with tuples
Source
let team = [("Ana Lima", "Design", true), ("Ben Okafor", "Engineering", false),
            ("Chen Wu", "Research", true)]

List {
  ForEach(team) { name, dept, online in
    Row(name, subtitle: dept, detail: online ? "Online" : "Away", avatar: name)
  }
  if team.count > 2 {
    Text("\(team.count) people").font(.footnote).foregroundStyle(.secondary)
  }
}
.frame(width: 420)

Lists, forms and controls

Account
Ana Lima
••••••
English
Preferences
Email notifications
Weekly digest
Reminders3
Nov 30, 2026
A settings form
Source
Form {
  Section("Account") {
    TextField("Name", text: "Ana Lima")
    SecureField("Password", text: "secret")
    Picker("Language", selection: "English") { Text("English"); Text("Deutsch"); Text("Français") }
  }
  Section("Preferences") {
    Toggle("Email notifications", isOn: true)
    Toggle("Weekly digest", isOn: false)
    Slider(value: 0.4)
    Stepper("Reminders", value: 3)
    DatePicker("Start date", selection: "2026-11-30")
  }
}
.frame(width: 460)

NavigationStack builds its bar from the content's .navigationTitle and .toolbar; .alert, .sheet and .confirmationDialog draw the presented state over the screen.

Settings
Edit
Settings
Wi-FiHome
BluetoothOn
Notifications2
Sign out?
You will need your password to sign in again.
CancelSign Out
Light
Settings
Edit
Settings
Wi-FiHome
BluetoothOn
Notifications2
Sign out?
You will need your password to sign in again.
CancelSign Out
Dark
Navigation and an alert
Source
NavigationStack {
  List {
    Row("Wi-Fi", detail: "Home", systemImage: "wifi", chevron: true)
    Row("Bluetooth", detail: "On", systemImage: "bolt", chevron: true)
    Row("Notifications", systemImage: "bell", chevron: true).badge(2)
  }
  .navigationTitle("Settings")
  .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Edit") } }
  .alert("Sign out?", isPresented: true) {
    Button("Cancel")
    Button("Sign Out", role: .destructive)
  } message: {
    Text("You will need your password to sign in again.")
  }
}

Images and icons

Image(systemName:) draws a built-in icon; SF Symbols, Material, Fluent and SAP icon names are all understood. Image("path") embeds a local file at build time (searched in the extension's asset_paths), so the page needs no extra asset handling; http(s) URLs are linked.

Dune Trail
Images and icons
Source
HStack(spacing: 16) {
  Image("assets/images/photo-2.svg").resizable().aspectRatio(contentMode: .fill)
    .frame(width: 180, height: 120).cornerRadius(12)
  VStack(alignment: .leading, spacing: 8) {
    Text("Dune Trail").font(.title3)
    HStack(spacing: 10) {
      Image(systemName: "mappin")
      Image(systemName: "star.fill").foregroundStyle(.yellow)
      Image(systemName: "favorite")
      Image(systemName: "sap-icon://shipping-status")
    }
    Rating(value: 4.5)
  }
}
.padding()

Appearance and devices

Packs define light and dark colours. appearance="auto" (this site's default) follows the page; both draws the two side by side. Devices set the frame size; fit shrink-wraps the content.

Light
Dark
Light and dark
Source
HStack(spacing: 12) {
  Banner("Backup complete", message: "1,204 files, 3.2 GB", severity: .success)
  Banner("Storage almost full", severity: .warning)
}
.padding()
.frame(width: 560)

Traceability: the Elements table

.id("…") and .ref("…") tag elements; elements="true" lists them under the figure — the structural contract a specification can cite.

Subtotal$118.00
Shipping$6.50
Total$124.50
Place order
SCR-CHK-2 · Checkout summary
IDElementComponentRefs
totalLabeledContent
place-orderButtonUC-CHK-3
Source
VStack(alignment: .leading, spacing: 10) {
  LabeledContent("Subtotal", value: "$118.00")
  LabeledContent("Shipping", value: "$6.50")
  Divider()
  LabeledContent("Total", value: "$124.50").bold().id("total")
  Button("Place order").buttonStyle(.borderedProminent).frame(maxWidth: .infinity)
    .id("place-order").ref("UC-CHK-3")
}
.padding()
.frame(width: 340)