Skip to content

Windows XP (Luna)

Imitates: Windows XP · Luna Blue visual style (Win32 common controls v6, shell) Windows XP (2001) · Pack id: winxp · Selected by: pack="winxp", import WindowsXP, import WinXP, import Luna · Default device: desktop (window chrome)

69 own elements, plus 134 core elements in this pack's style. Each entry shows the element rendered with sample arguments (and, for the pack's own elements, each of its variants), the role it maps onto, its positional arguments, its defaults and variants.

Pack elements

AddressBar

Address combo with its label: AddressBar("C:\Documents and Settings")

role select · arguments value · defaults label: "Address", systemImage: "folder"

Value
Source
AddressBar("Value")

AllProgramsButton

All Programs ▸ with the green arrow

role button · arguments label · defaults label: "All Programs"

All Programs
Source
AllProgramsButton()

BackButton

Green round Back arrow

role button · arguments label · defaults label: "Back", systemImage: "arrow.left", variant: "toolbar"

Back
Source
BackButton()

Balloon

Notification balloon pointing at its child: Balloon("Updates are ready", message: "…") { TrayIcon("shield") }

role tooltip · arguments text · defaults placement: "top"

ContentActionText
Source
Balloon("Text") { Text("Content"); Button("Action") }

BrandGlyph

A neutral waving-flag glyph standing in for the system logo (Welcome screen, About boxes)

role icon · arguments name · defaults name: "flag"

Source
BrandGlyph()

Control Panel category: CategoryLink("Appearance and Themes", systemImage: "photo") — 32 px icon and blue text

role link · arguments label

Label
Source
CategoryLink("Label")

CheckBox

13 px box with the green check: CheckBox("Show hidden files", checked: true)

role checkbox · arguments label

Label
Source
CheckBox("Label")

Clock

Taskbar clock

role text · arguments content · defaults content: "10:42 AM"

10:42 AM
Source
Clock()

ComboBox

Drop-down combo with the blue arrow button: ComboBox("Size", items:, selection:)

role select · arguments label

Source
ComboBox("Label")

ContextMenu

Pop-up menu (white with the #316ac5 highlight)

role menu · arguments label

Label
Source
ContextMenu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }

DateTimePicker

Date picker field with the drop-down arrow

role datepicker · arguments label

Source
DateTimePicker("Label")

DefaultButton

The dialog's default (Enter) button

role button · arguments label · defaults variant: "default"

Label
Source
DefaultButton("Label")

Desktop

The desktop with a sky-and-hill wallpaper; place windows and icons with .position(x:y:)

role canvas

ContentAction
Source
Desktop() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)

DesktopIcon

DesktopIcon("My Computer", systemImage: "computer") — 32 px icon over a white shadowed label; .selected()

role label · arguments title

Title
Source
DesktopIcon("Title")

DialogBody

Root of a dialog screen: the frame's title bar keeps only Close (and ? with .variant(.help)).

role vstack · variants help

ContentAction
help
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { DialogBody() { Text("Content"); Button("Action") }.variant("help"); Text("help").font(.caption).foregroundStyle(.secondary) }
}

Drop-down list (not editable)

role select · arguments label

Source
DropDownList("Label")

FileIcon

FileIcon("Budget.xls", systemImage: "doc") · .variant(.tiles) puts the name beside a 32 px icon

role label · arguments title · variants icons, tiles

Titleicons
Titletiles
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { FileIcon("Title").variant("icons"); Text("icons").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { FileIcon("Title").variant("tiles"); Text("tiles").font(.caption).foregroundStyle(.secondary) }
}

ForwardButton

Green round Forward arrow

role button · arguments label · defaults systemImage: "arrow.right", variant: "toolbar"

Label
Source
ForwardButton("Label")

Frame

Group box: thin rounded frame with a blue caption (also GroupBox)

role card · arguments title

Title
ContentAction
Source
Frame("Title") { Text("Content"); Button("Action") }

GoButton

The green Go arrow beside the address bar

role button · arguments label · defaults label: "Go", systemImage: "arrow.right", variant: "toolbar"

Go
Source
GoButton()

IconView

Icons / Tiles view: a grid of FileIcon

role grid

ContentAction
Source
IconView() { Text("Content"); Button("Action") }

ListBox

Single-selection list box with a sunken border

role list

First item
Second item
Source
ListBox() { Text("First item"); Text("Second item") }

ListView

Details view: columns:, rows:, sortColumn:, selectedRows:

role table · variants details, report

NameStatus
Ana LimaActive
Ben OkaforAway
details
NameStatus
Ana LimaActive
Ben OkaforAway
report
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ListView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("details"); Text("details").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("report"); Text("report").font(.caption).foregroundStyle(.secondary) }
}

LogOffButton

Start menu footer: Log Off

role button · arguments label · defaults label: "Log Off", systemImage: "key"

Log Off
Source
LogOffButton()

A classic menu bar: MenuBarItem("File")…

role toolbar

Source
MenuBar() { Button("Save"); Button("Share") }

A menu bar title; .selected() when its menu is open

role button · arguments label · defaults variant: "plain"

Label
Source
MenuBarItem("Label")

MessageBox

Modal message box: MessageBox("Disk Cleanup", message: "…", systemImage: "exclamationmark.triangle", severity: .warning, buttons: ["OK"])

role dialog · arguments title · variants information, warning, error, question

information
warning
error
question
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { MessageBox("Title") { Text("Content"); Button("Action") }.variant("information"); Text("information").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { MessageBox("Title") { Text("Content"); Button("Action") }.variant("warning"); Text("warning").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { MessageBox("Title") { Text("Content"); Button("Action") }.variant("error"); Text("error").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { MessageBox("Title") { Text("Content"); Button("Action") }.variant("question"); Text("question").font(.caption).foregroundStyle(.secondary) }
}

MonthCalendar

Month calendar with the blue title band

role calendar

November 2026
SuMoTuWeThFrSa12345678910111213141516171819202122232425262728293012345
Source
MonthCalendar()

MultilineTextBox

Multi-line edit control

role textfield · arguments text · defaults kind: "multiline"

Text
Source
MultilineTextBox("Text")

NotificationArea

The light-blue tray at the right of the taskbar: TrayIcon… Clock

role hstack

ContentAction
Source
NotificationArea() { Text("Content"); Button("Action") }

OptionButton

Radio button with the green dot (also RadioButton)

role radio · arguments label

Label
Source
OptionButton("Label")

PasswordBox

Password edit (black dots)

role textfield · arguments placeholder · defaults kind: "password"

Placeholder
Source
PasswordBox("Placeholder")

ProgressBar

Green block progress: ProgressBar(value: 0.6)

role progress · arguments label · variants blocks, marquee

Label
blocks
Label
marquee
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ProgressBar("Label").variant("blocks"); Text("blocks").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ProgressBar("Label").variant("marquee"); Text("marquee").font(.caption).foregroundStyle(.secondary) }
}

PropertyRow

A label: value line in a property sheet

role labeled · arguments label, value

LabelContentAction
Source
PropertyRow("Label", "Value") { Text("Content"); Button("Action") }

PushButton

75×23 rounded button; .variant(.default) draws the blue default-button glow, .state(.hover) the orange one

role button · arguments label · variants default, standard

Labeldefault
Labelstandard
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { PushButton("Label").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { PushButton("Label").variant("standard"); Text("standard").font(.caption).foregroundStyle(.secondary) }
}

QuickLaunch

Quick Launch toolbar: small IconButtons beside Start

role hstack

ContentAction
Source
QuickLaunch() { Text("Content"); Button("Action") }

RadioButtonList

RadioButtonList("View", items: […], selection:)

role radiogroup · arguments label

Label
Source
RadioButtonList("Label")

StartButton

The green Start button (.selected() while the menu is open)

role button · arguments label · defaults label: "start", systemImage: "flag"

start
Source
StartButton()

StartMenu

Two-column Start menu: StartMenu("Alex", avatar: "Alex") { StartMenuPrograms{…} StartMenuPlaces{…} } actions: { LogOffButton() TurnOffButton() }

role card · arguments title

Title
ContentAction
Source
StartMenu("Title") { Text("Content"); Button("Action") }

StartMenuItem

StartMenuItem("Internet", subtitle: "Web browser", systemImage: "globe")

role listitem · arguments title

Title
Source
StartMenuItem("Title")

StartMenuPlaces

The light-blue right column (My Documents, Control Panel, Help, Search, Run…)

role vstack

ContentAction
Source
StartMenuPlaces() { Text("Content"); Button("Action") }

StartMenuPrograms

The white left column of the Start menu (pinned and frequent programs)

role vstack

ContentAction
Source
StartMenuPrograms() { Text("Content"); Button("Action") }

StatusBar

Window status bar of sunken StatusBarPanels

role hstack

ContentAction
Source
StatusBar() { Text("Content"); Button("Action") }

StatusBarPanel

One status bar field

role text · arguments content

Content
Source
StatusBarPanel("Content")

Hyperlink text control

role link · arguments label

Label
Source
SysLink("Label")

SystemTray

Alias of NotificationArea

role hstack

ContentAction
Source
SystemTray() { Text("Content"); Button("Action") }

TabControl

Property-sheet tabs with the orange hot-track line on the selected tab

role tabs · defaults placement: "top"

OneTwo
First tab
Source
TabControl() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

TabPage

TabPage("General") { … }

role tab · arguments label

Source
TabPage("Label")

TaskLink("Rename this file", systemImage: "pencil")

role link · arguments label

Label
Source
TaskLink("Label")

TaskPane

Explorer's blue common-tasks pane holding TaskPaneSections

role vstack

ContentAction
Source
TaskPane() { Text("Content"); Button("Action") }

TaskPaneSection

Collapsible task box: TaskPaneSection("File and Folder Tasks") { TaskLink(…) } · .variant(.special) for the dark-blue header

role accordion · arguments title · defaults expanded: True · variants standard, special

Title
ContentAction
standard
Title
ContentAction
special
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { TaskPaneSection("Title") { Text("Content"); Button("Action") }.variant("standard"); Text("standard").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { TaskPaneSection("Title") { Text("Content"); Button("Action") }.variant("special"); Text("special").font(.caption).foregroundStyle(.secondary) }
}

Taskbar

The blue taskbar: StartButton, QuickLaunch, TaskbarButton…, Spacer, NotificationArea

role hstack

ContentAction
Source
Taskbar() { Text("Content"); Button("Action") }

TaskbarButton

A window's taskbar button; .selected() for the active window

role button · arguments label

Label
Source
TaskbarButton("Label")

TextBox

Edit control with the #7f9db9 border

role textfield · arguments placeholder

Placeholder
Source
TextBox("Placeholder")

ToolBar

Explorer's Standard Buttons toolbar (flat buttons, raised on hover)

role toolbar

Source
ToolBar() { Button("Save"); Button("Share") }

ToolBarButton

ToolBarButton("Search", systemImage: "search")

role button · arguments label · defaults variant: "toolbar"

Label
Source
ToolBarButton("Label")

ToolTip

Pale yellow tooltip

role tooltip · arguments text

ContentActionText
Source
ToolTip("Text") { Text("Content"); Button("Action") }

TrackBar

Slider with the pointed thumb: TrackBar(value: 30, in: 0...100, ticks: 10)

role slider

Source
TrackBar()

TrayIcon

A 16 px notification icon

role icon · arguments name

Source
TrayIcon("star")

TreeView

Folders tree with dotted lines and +/− boxes

role tree

Folder
File
Source
TreeView() { TreeItem("Folder") { TreeItem("File") } }

TreeViewItem

TreeViewItem("My Documents", systemImage: "folder")

role treeitem · arguments label

Label
Source
TreeViewItem("Label")

TurnOffButton

Start menu / Welcome screen: the red power button

role button · arguments label · defaults label: "Turn Off Computer", systemImage: "power"

Turn Off Computer
Source
TurnOffButton()

UpButton

Up one level

role button · arguments label · defaults systemImage: "arrow.up", variant: "toolbar"

Label
Source
UpButton("Label")

UpDown

Spin box: UpDown("Copies", value: 2)

role stepper · arguments label

Label
Source
UpDown("Label")

UserTile

A user picture and name on the Welcome screen: UserTile("Alex", subtitle: "Type your password", image: …)

role listitem · arguments title

Title
Source
UserTile("Title")

WelcomeBand

Dark blue band at the top or bottom of the Welcome screen

role hstack

ContentAction
Source
WelcomeBand() { Text("Content"); Button("Action") }

WelcomeScreen

The blue Welcome (log-on) screen: header band, centre, footer band

role vstack

ContentAction
Source
WelcomeScreen() { Text("Content"); Button("Action") }

Window

A Luna window drawn inside a Desktop: blue title bar with min/max/close. Window("My Computer", systemImage: "computer") { … } · .variant(.inactive | .dialog | .tool)

role card · arguments title · variants active, inactive, dialog, tool

Title
ContentAction
active
Title
ContentAction
inactive
Title
ContentAction
dialog
Title
ContentAction
tool
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("active"); Text("active").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("inactive"); Text("inactive").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("dialog"); Text("dialog").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("tool"); Text("tool").font(.caption).foregroundStyle(.secondary) }
}

Wizard

Wizard page: white header band (title, subtitle:, systemImage:), body, and actions: { < Back · Next > · Cancel }

role card · arguments title

Title
ContentAction
Source
Wizard("Title") { Text("Content"); Button("Action") }

Core vocabulary in this style

Accordion

role accordion · arguments title

Title
Source
Accordion("Title") { Text("Content"); Button("Action") }

Alert

role dialog · arguments title · defaults variant: "alert"

Source
Alert("Title") { Text("Content"); Button("Action") }

AppBar

role appbar · arguments title

Source
AppBar("Title") { Text("Content"); Button("Action") }

AreaChart

role chart · defaults kind: "area"

Source
AreaChart(values: [3, 5, 2, 6, 4])

AsyncImage

role image · arguments url

Source
AsyncImage().frame(width: 160, height: 96)

Avatar

role avatar · arguments name

AL
Source
Avatar("Ana Lima")

Badge

role badge · arguments text

Text
Source
Badge("Text")

role alert · arguments title

Source
Banner("Title")

BarChart

role chart · defaults kind: "bar"

Source
BarChart(values: [3, 5, 2, 6, 4])

Board

Kanban board of BoardColumn children

role board

To do1
Write copy
Add card
Source
Board() { BoardColumn("To do") { KanbanCard("Write copy") } }

BoardColumn

BoardColumn("To do", count:, color:) { KanbanCard(…) }

role boardcolumn · arguments title

Title2
Write copy
Review
Add card
Source
BoardColumn("Title") { KanbanCard("Write copy"); KanbanCard("Review") }

role breadcrumb · arguments items

Source
Breadcrumb(["One", "Two", "Three"])

BubbleChart

role chart · defaults kind: "bubble"

Source
BubbleChart(values: [3, 5, 2, 6, 4])

Button

Button("Save", systemImage:) · .buttonStyle(…)

role button · arguments label

Label
Source
Button("Label")

Calendar

role calendar

November 2026
SuMoTuWeThFrSa12345678910111213141516171819202122232425262728293012345
Source
Calendar()

Callout

a numbered annotation; place with .position(x:y:)

role callout · arguments number, text

1Text
Source
Callout(1, "Text")

CandlestickChart

role chart · defaults kind: "candlestick"

Source
CandlestickChart(values: [3, 5, 2, 6, 4])

Canvas

free-form area; place children with .position(x:y:); grid: .dots|.lines

role canvas

ContentAction
Source
Canvas() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)

Capsule

role shape · defaults shape: "capsule"

Source
Capsule().frame(width: 160, height: 96)

Card

role card · arguments title

Title
ContentAction
Source
Card("Title") { Text("Content"); Button("Action") }

Chart

kind: .bar|.line|.area|.pie|.donut|.scatter|.bubble|.radar|.heatmap|.funnel|.treemap|.gauge|.candlestick|.combo|.sparkline; values:/series:/labels:/points:/matrix:

role chart

Source
Chart(values: [3, 5, 2, 6, 4])

Checkbox

role checkbox · arguments label

Label
Source
Checkbox("Label")

Chip

role chip · arguments label

Label
Source
Chip("Label")

Circle

role shape · defaults shape: "circle"

Source
Circle().frame(width: 160, height: 96)

CodeBlock

role code · arguments code · defaults lineNumbers: False

let total = items.count
Source
CodeBlock("let total = items.count")

CodeEditor

CodeEditor("…", language: "swift", lineNumbers:, highlight: [3], tabs: [..])

role code · arguments code

1let total = items.count
Source
CodeEditor("let total = items.count")

Color

role color · arguments color

Source
Color(.blue).frame(width: 160, height: 96)

ColorSwatches

colors: [.red, "#0af", …], selection:

role swatches

Source
ColorSwatches()

ComboChart

role chart · defaults kind: "combo"

Source
ComboChart(values: [3, 5, 2, 6, 4])

Comment

author:, time:, avatar:

role message · arguments text · defaults variant: "comment"

Text
Source
Comment("Text")

ControlGroup

role toolbar · defaults variant: "group"

Source
ControlGroup() { Button("Save"); Button("Share") }

DatePicker

selection: "2026-11-23"; .datePickerStyle(.graphical)

role datepicker · arguments label

Source
DatePicker("Label")

Dialog

role dialog · arguments title

Source
Dialog("Title") { Text("Content"); Button("Action") }

DisclosureGroup

role accordion · arguments title

Title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }

Divider

role divider

Source
Divider()

DonutChart

role chart · defaults kind: "donut"

Source
DonutChart(values: [3, 5, 2, 6, 4])

Dropzone

role dropzone · arguments label

Label
Source
Dropzone("Label")

Ellipse

role shape · defaults shape: "ellipse"

Source
Ellipse().frame(width: 160, height: 96)

EmptyState

title, systemImage:, description: { actions }

role emptystate · arguments title

Title
Source
EmptyState("Title")

FloatingActionButton

role fab · arguments icon

Source
FloatingActionButton("star")

Form

role form

Name
Notifications
Source
Form() { TextField("Name"); Toggle("Notifications", isOn: true) }

FunnelChart

role chart · defaults kind: "funnel"

Source
FunnelChart(values: [3, 5, 2, 6, 4])

Gantt

scale: ["W1",…], tasks: [("Design", 0, 2, 0.6), …], today:

role gantt

1234567
Design
Build
Source
Gantt(tasks: [("Design", 0, 3), ("Build", 2, 5)])

Gauge

role progress · arguments value · defaults variant: "gauge"

Source
Gauge(60)

GaugeChart

role chart · defaults kind: "gauge"

Source
GaugeChart(values: [3, 5, 2, 6, 4])

Grid

Grid of GridRow children, or columns: n

role grid

ContentAction
Source
Grid() { Text("Content"); Button("Action") }

GridRow

role gridrow

ContentAction
Source
GridRow() { Text("Content"); Button("Action") }

Group

role group

ContentAction
Source
Group() { Text("Content"); Button("Action") }

GroupBox

role card · arguments title

Title
ContentAction
Source
GroupBox("Title") { Text("Content"); Button("Action") }

HStack

Horizontal stack. spacing:, alignment: .top|.center|.bottom

role hstack

ContentAction
Source
HStack() { Text("Content"); Button("Action") }

Heatmap

role chart · defaults kind: "heatmap"

Source
Heatmap(values: [3, 5, 2, 6, 4])

Histogram

role chart · defaults kind: "histogram"

Source
Histogram(values: [3, 5, 2, 6, 4])

Icon

role icon · arguments name

Source
Icon("star")

IconButton

role button · arguments icon · defaults iconOnly: True

Source
IconButton("star")

Image

Image("path.png") or Image(systemName: "star")

role image · arguments name

Source
Image().frame(width: 160, height: 96)

KanbanCard

title, description:, tags: [..], assignees: [..], due:, comments:, priority:

role kanbancard · arguments title

Title
Source
KanbanCard("Title")

Kbd

Kbd(["⌘", "K"]) or Kbd("Esc")

role kbd · arguments keys

⌘K
Source
Kbd(["⌘", "K"])

Label

Label("Inbox", systemImage: "tray")

role label · arguments title

Title
Source
Label("Title")

LabeledContent

role labeled · arguments label, value

LabelContentAction
Source
LabeledContent("Label", "Value") { Text("Content"); Button("Action") }

LazyHGrid

role grid

ContentAction
Source
LazyHGrid() { Text("Content"); Button("Action") }

LazyHStack

role hstack

ContentAction
Source
LazyHStack() { Text("Content"); Button("Action") }

LazyVGrid

columns: [GridItem(.flexible()), …] or a count

role grid

ContentAction
Source
LazyVGrid() { Text("Content"); Button("Action") }

LazyVStack

role vstack

ContentAction
Source
LazyVStack() { Text("Content"); Button("Action") }

LineChart

role chart · defaults kind: "line"

Source
LineChart(values: [3, 5, 2, 6, 4])

role link · arguments label, destination

Label
Source
Link("Label")

List

.listStyle(.insetGrouped|.plain|.sidebar|…)

role list

First item
Second item
Source
List() { Text("First item"); Text("Second item") }

ListItem

role listitem · arguments title

Title
Source
ListItem("Title")

Map

pins: [(x%, y%, "label")], route:, showsUserLocation:, height:

role map

Source
Map().frame(width: 160, height: 96)

role menu · arguments label

Label
Source
Menu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }

role menuitem · arguments label

Source
MenuItem("Label")

MessageBubble

MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])

role message · arguments text

Text
Source
MessageBubble("Text")

role navitem · arguments label

Label
Source
NavItem("Label")

role listitem · arguments title · defaults chevron: True

Title
Source
NavigationLink("Title")

{ sidebar } content: { … } detail: { … }

role split

Content
Action
Source
NavigationSplitView() { Text("Content"); Button("Action") }

Content's .navigationTitle / .toolbar form the bar

role navstack

ContentAction
Source
NavigationStack() { Text("Content"); Button("Action") }

role navstack

ContentAction
Source
NavigationView() { Text("Content"); Button("Action") }

Pagination

role pagination

Source
Pagination()

Picker

Picker("Size", selection: "M") { Text("S") … }

role select · arguments label

Source
Picker("Label")

PieChart

role chart · defaults kind: "pie"

Source
PieChart(values: [3, 5, 2, 6, 4])

Placeholder

A labelled box for maps, charts, media

role placeholder · arguments label

Label
Source
Placeholder("Label").frame(width: 160, height: 96)

Pointer

Pointer(.arrow|.hand|.ibeam|.grab|.crosshair|.touch); place with .position

role pointer · arguments kind

Source
Pointer(.arrow)

ProgressView

value: 0…1 (or total:); none = indeterminate

role progress · arguments label

Label
Source
ProgressView("Label")

RadarChart

role chart · defaults kind: "radar"

Source
RadarChart(values: [3, 5, 2, 6, 4])

RadioButton

role radio · arguments label

Label
Source
RadioButton("Label")

RadioGroup

role radiogroup · arguments label

Label
Source
RadioGroup("Label")

Rating

role rating · arguments value

Source
Rating(60)

Rectangle

role shape · defaults shape: "rectangle"

Source
Rectangle().frame(width: 160, height: 96)

RoundedRectangle

role shape · defaults shape: "rounded"

Source
RoundedRectangle().frame(width: 160, height: 96)

Row

title, subtitle:, detail:, systemImage:, chevron:

role listitem · arguments title

Title
Source
Row("Title")

ScatterChart

role chart · defaults kind: "scatter"

Source
ScatterChart(values: [3, 5, 2, 6, 4])

Schedule

days: [..], startHour:, endHour:, events: [("Standup", "Mon", 9, 9.5, .blue)], now:

role schedule

8:009:0010:0011:0012:0013:0014:0015:0016:0017:00
Mon
Tue
Wed
Thu
Fri
Source
Schedule()

ScrollView

role scroll · arguments axes

ContentAction
Source
ScrollView() { Text("Content"); Button("Action") }

SearchField

role textfield · arguments placeholder · defaults kind: "search"

Placeholder
Source
SearchField("Placeholder")

Section

Section("Header") { … } footer: { … }

role section · arguments title

Title
First itemSecond item
Source
Section("Title") { Text("First item"); Text("Second item") }

SecureField

role textfield · arguments placeholder · defaults kind: "password"

Placeholder
Source
SecureField("Placeholder")

SegmentedControl

role segmented · arguments items

OneTwoThree
Source
SegmentedControl(["One", "Two", "Three"])

SelectionRect

a drag-selection rectangle; size with .frame, place with .position

role marquee

Source
SelectionRect()

Sheet

role dialog · arguments title · defaults variant: "sheet"

Source
Sheet("Title") { Text("Content"); Button("Action") }

role sidebar · arguments title

Source
Sidebar("Title") { Text("Content"); Button("Action") }

Skeleton

lines:, avatar:, image:, shape: .circle|.rectangle|.text

role skeleton

Source
Skeleton().frame(width: 160, height: 96)

Slider

Slider(value: 0.4) or Slider(value: 30, in: 0...100)

role slider

Source
Slider()

Spacer

role spacer

Source
Spacer()

Sparkline

role chart · arguments values · defaults kind: "sparkline"

Source
Sparkline([3, 5, 2, 6, 4], values: [3, 5, 2, 6, 4])

Spreadsheet

rows: [[…]], selection: "B2:C4", active:, formula:, sheets: [..], highlight: ["B3": .yellow]

role spreadsheet

AB
1AB
212
334
Source
Spreadsheet(columns: ["A", "B"], rows: [[1, 2], [3, 4]])

Stat

Stat("Revenue", "$48k", change: "+12%", trend: [..], systemImage:)

role stat · arguments label, value

Label
60
Source
Stat("Label", 60)

Stepper

role stepper · arguments label

Label
Source
Stepper("Label")

Steps

role steps · arguments steps

1Cart
2Shipping
3Payment
Source
Steps(["Cart", "Shipping", "Payment"])

StickyNote

StickyNote("Call Ana", color: .yellow, rotation: -2, author:)

role stickynote · arguments text

Text
Source
StickyNote("Text")

Tab

Tab("Home", systemImage: "house") { … }

role tab · arguments label

Source
Tab("Label")

TabView

Children with .tabItem { Label } or Tab(…)

role tabs · defaults placement: "bottom"

OneTwo
First tab
Source
TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

Table

columns: ["Name", …], rows: [[…], …] or TableRow children

role table

NameStatus
Ana LimaActive
Ben OkaforAway
Source
Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])

TableColumn

role tablecolumn · arguments title

Source
TableColumn("Title")

TableRow

role tablerow

Source
TableRow()

Tabs

role tabs · arguments items · defaults placement: "top"

OneTwo
First tab
Source
Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

Tag

role chip · arguments label

Label
Source
Tag("Label")

Terminal

lines starting with "$ " are commands

role code · arguments code · defaults variant: "terminal"

Terminal
let total = items.count
Source
Terminal("let total = items.count")

Text

Text with bold, italic, code Markdown

role text · arguments content

Content
Source
Text("Content")

TextEditor

role textfield · arguments text · defaults kind: "multiline"

Text
Source
TextEditor("Text")

TextField

TextField("Placeholder", text: "value")

role textfield · arguments placeholder

Placeholder
Source
TextField("Placeholder")

Timeline

role timeline

Created
Shipped
Source
Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }

TimelineItem

title, time:, description:, systemImage:, status:

role timelineitem · arguments title

Title
Source
TimelineItem("Title")

Toast

role toast · arguments message

Message
Source
Toast("Message")

Toggle

Toggle("Wi-Fi", isOn: true)

role toggle · arguments label

Label
Source
Toggle("Label")

Toolbar

role toolbar

Source
Toolbar() { Button("Save"); Button("Share") }

ToolbarItem

ToolbarItem(placement: .topBarTrailing) { … }

role toolbaritem

ContentAction
Source
ToolbarItem() { Text("Content"); Button("Action") }

ToolbarItemGroup

role toolbaritem

ContentAction
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }

Tooltip

role tooltip · arguments text

ContentActionText
Source
Tooltip("Text") { Text("Content"); Button("Action") }

Tree

Tree { TreeItem("src") { TreeItem("main.swift") } }

role tree

Folder
File
Source
Tree() { TreeItem("Folder") { TreeItem("File") } }

TreeItem

label, systemImage:, folder:, expanded:, selected:, detail:

role treeitem · arguments label

Label
Source
TreeItem("Label")

Treemap

role chart · defaults kind: "treemap"

Source
Treemap(values: [3, 5, 2, 6, 4])

VStack

Vertical stack. spacing:, alignment: .leading|.center|.trailing

role vstack

ContentAction
Source
VStack() { Text("Content"); Button("Action") }

VideoPlayer

poster image, progress: 0…1, time:, duration:, playing:

role media · arguments image

Source
VideoPlayer().frame(width: 160, height: 96)

Whiteboard

role canvas · defaults grid: "dots"

ContentAction
Source
Whiteboard() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)

ZStack

Overlapping layers. alignment:

role zstack

ContentAction
Source
ZStack() { Text("Content"); Button("Action") }