NeXTSTEP¶
Imitates: NeXTSTEP 3.x Application Kit / OPENSTEP 4 · Workspace Manager (1989–1997) NeXTSTEP 3.3 · Pack id: nextstep · Selected by: pack="nextstep", import NeXTSTEP, import AppKitNeXT, import OpenStep · Default device: desktop (window chrome)
78 own elements, plus 124 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¶
AlertPanel¶
An alert panel: title bar, application icon, bold title, message and buttons with the default (return) one on the right
role dialog · arguments title · defaults icon: "Application", variant: "alert"
Source
AlertPanel("Title") { Text("Content"); Button("Action") }AppIcon¶
A 64 px Dock tile; .variant(.idle) shows the ellipsis of an application that is not running
role button · arguments label · defaults iconOnly: True, variant: "running" · variants running, idle
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { AppIcon("Label").variant("running"); Text("running").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { AppIcon("Label").variant("idle"); Text("idle").font(.caption).foregroundStyle(.secondary) }
}Box¶
A Box: a grooved frame with its title at the top-left
role card · arguments title · defaults variant: "box"
Source
Box("Title") { Text("Content"); Button("Action") }Browser¶
The column browser: BrowserColumn children, each with its own scroller on the left
role hstack · defaults alignment: "stretch", spacing: 0
Source
Browser() { Text("Content"); Button("Action") }BrowserCell¶
A branch cell (folder): title and the right arrow; .selected() highlights it white
role listitem · arguments title · defaults chevron: True
Source
BrowserCell("Title")BrowserColumn¶
One column of a Browser: BrowserCell (branch, with the arrow) and BrowserLeaf rows
role list
Source
BrowserColumn() { Text("First item"); Text("Second item") }BrowserLeaf¶
A leaf cell (file) without the arrow
role listitem · arguments title
Source
BrowserLeaf("Title")Button¶
A bevelled push button; .variant(.default) (or ReturnButton) adds the return glyph; .selected() is the highlighted (white) state
role button · arguments label · variants default, plain, icontop, image
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("icontop"); Text("icontop").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("image"); Text("image").font(.caption).foregroundStyle(.secondary) }
}ButtonCell¶
A bevelled push button; .variant(.default) (or ReturnButton) adds the return glyph; .selected() is the highlighted (white) state
role button · arguments label · variants default, plain, icontop, image
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ButtonCell("Label").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ButtonCell("Label").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ButtonCell("Label").variant("icontop"); Text("icontop").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ButtonCell("Label").variant("image"); Text("image").font(.caption).foregroundStyle(.secondary) }
}ButtonRow¶
A row of buttons along a window's top (Mail, Edit)
role toolbar · defaults variant: "buttonrow"
Source
ButtonRow() { Button("Save"); Button("Share") }ColorWell¶
A colour well: a bevelled frame around a colour swatch
role color · arguments color
Source
ColorWell(.blue).frame(width: 160, height: 96)DBTableView¶
A table view: raised column titles over a white grid (Mail's message list)
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
DBTableView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])Dock¶
The Dock: a column of 64 px tiles at the right edge of the screen
role vstack · defaults alignment: "center", spacing: 0
Source
Dock() { Text("Content"); Button("Action") }DockTile¶
A 64 px Dock tile; .variant(.idle) shows the ellipsis of an application that is not running
role button · arguments label · defaults iconOnly: True, variant: "running" · variants running, idle
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { DockTile("Label").variant("running"); Text("running").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DockTile("Label").variant("idle"); Text("idle").font(.caption).foregroundStyle(.secondary) }
}FileIcon¶
A Workspace icon: a 48 px picture with its name below; .selected() boxes the name
role label · arguments title
Source
FileIcon("Title")Form¶
A Form: a column of FormCells
role vstack · defaults alignment: "stretch", spacing: 4
Source
Form() { Text("Content"); Button("Action") }FormCell¶
A Form entry: the title on the left, the bezelled field on the right
role textfield · arguments label
Source
FormCell("Label")IconButton¶
A square bevelled button with only an icon
role button · arguments icon · defaults iconOnly: True, variant: "image"
Source
IconButton("star")ImageButton¶
A button showing an icon above its title (Mail's and Preferences' button rows)
role button · arguments label · defaults variant: "icontop"
Source
ImageButton("Label")Matrix¶
A Matrix of radio button cells: RadioMatrix("Title", items: […], selection:)
role radiogroup · arguments label
Source
Matrix("Label")Menu¶
A vertical menu: black title bar over a column of menu cells; MenuItem / SubmenuItem children
role card · arguments title · defaults variant: "menu" · variants menu, torn
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Menu("Title") { Text("Content"); Button("Action") }.variant("menu"); Text("menu").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Menu("Title") { Text("Content"); Button("Action") }.variant("torn"); Text("torn").font(.caption).foregroundStyle(.secondary) }
}MenuCell¶
A menu cell: shortcut: "c" shows the Command-key equivalent on the right; .selected() highlights it white
role menuitem · arguments label
Source
MenuCell("Label")MenuItem¶
A menu cell: shortcut: "c" shows the Command-key equivalent on the right; .selected() highlights it white
role menuitem · arguments label
Source
MenuItem("Label")MiniWindow¶
A miniaturized window: a 64 px tile with its title strip at the bottom
role button · arguments label · defaults variant: "miniwindow"
Source
MiniWindow("Label")NSBox¶
A Box: a grooved frame with its title at the top-left
role card · arguments title · defaults variant: "box"
Source
NSBox("Title") { Text("Content"); Button("Action") }NSBrowser¶
The column browser: BrowserColumn children, each with its own scroller on the left
role hstack · defaults alignment: "stretch", spacing: 0
Source
NSBrowser() { Text("Content"); Button("Action") }NSButton¶
A bevelled push button; .variant(.default) (or ReturnButton) adds the return glyph; .selected() is the highlighted (white) state
role button · arguments label · variants default, plain, icontop, image
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NSButton("Label").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSButton("Label").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSButton("Label").variant("icontop"); Text("icontop").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSButton("Label").variant("image"); Text("image").font(.caption).foregroundStyle(.secondary) }
}NSColorWell¶
A colour well: a bevelled frame around a colour swatch
role color · arguments color
Source
NSColorWell(.blue).frame(width: 160, height: 96)NSForm¶
A Form: a column of FormCells
role vstack · defaults alignment: "stretch", spacing: 4
Source
NSForm() { Text("Content"); Button("Action") }NSFormCell¶
A Form entry: the title on the left, the bezelled field on the right
role textfield · arguments label
Source
NSFormCell("Label")NSMenu¶
A vertical menu: black title bar over a column of menu cells; MenuItem / SubmenuItem children
role card · arguments title · defaults variant: "menu" · variants menu, torn
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NSMenu("Title") { Text("Content"); Button("Action") }.variant("menu"); Text("menu").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSMenu("Title") { Text("Content"); Button("Action") }.variant("torn"); Text("torn").font(.caption).foregroundStyle(.secondary) }
}NSMenuItem¶
A menu cell: shortcut: "c" shows the Command-key equivalent on the right; .selected() highlights it white
role menuitem · arguments label
Source
NSMenuItem("Label")NSPanel¶
A panel (inspector, find, info): title bar with the close button only, no resize bar
role card · arguments title · defaults variant: "panel" · variants panel, panelMain, panelInactive
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NSPanel("Title") { Text("Content"); Button("Action") }.variant("panel"); Text("panel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSPanel("Title") { Text("Content"); Button("Action") }.variant("panelMain"); Text("panelMain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSPanel("Title") { Text("Content"); Button("Action") }.variant("panelInactive"); Text("panelInactive").font(.caption).foregroundStyle(.secondary) }
}NSPopUpButton¶
A pop-up list: a raised button with the small bar indicator on the right
role select · arguments label
Source
NSPopUpButton("Label")NSProgressIndicator¶
A progress bar (OPENSTEP 4): sunken trough with a dark fill
role progress
Source
NSProgressIndicator()NSRadioButton¶
A radio button: a round bezel, dark when on
role radio · arguments label
Source
NSRadioButton("Label")NSRulerView¶
The Text ruler: a tick-marked strip with alignment, spacing and tab controls
role toolbar · defaults variant: "ruler"
Source
NSRulerView() { Button("Save"); Button("Share") }NSScrollView¶
A ScrollView with its scroller on the LEFT (NeXT style: knob in a dark trough, both arrows at the bottom)
role scroll
Source
NSScrollView() { Text("Content"); Button("Action") }NSSecureTextField¶
A text field that shows bullets
role textfield · arguments label · defaults kind: "password"
Source
NSSecureTextField("Label")NSSlider¶
A slider: a sunken dark grey trough and a raised knob with a dimple
role slider · arguments label
Source
NSSlider("Label")NSSplitView¶
A split view: put Divider() between the panes to get the dimpled divider bar
role vstack · defaults alignment: "stretch", spacing: 0
Source
NSSplitView() { Text("Content"); Button("Action") }NSSubmenuItem¶
A menu cell that opens a submenu (the arrow on the right); .selected() while its submenu is attached
role menuitem · arguments label
Source
NSSubmenuItem("Label")NSSwitchButton¶
A switch: a small bevelled square that shows a check mark when on
role checkbox · arguments label
Source
NSSwitchButton("Label")NSTableView¶
A table view: raised column titles over a white grid (Mail's message list)
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
NSTableView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])NSTextField¶
A bezelled text field (white, sunken)
role textfield · arguments label
Source
NSTextField("Label")NSTextView¶
A Text object in a ScrollView: white page with the scroller on the left
role textfield · arguments label · defaults kind: "multiline"
Source
NSTextView("Label")NSWindow¶
A titled window: black title bar when key (.variant(.main) dark grey, .variant(.inactive) light grey), miniaturize button left, close button right, resize bar at the bottom
role card · arguments title · defaults variant: "key" · variants key, main, inactive
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NSWindow("Title") { Text("Content"); Button("Action") }.variant("key"); Text("key").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSWindow("Title") { Text("Content"); Button("Action") }.variant("main"); Text("main").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NSWindow("Title") { Text("Content"); Button("Action") }.variant("inactive"); Text("inactive").font(.caption).foregroundStyle(.secondary) }
}NXBrowser¶
The column browser: BrowserColumn children, each with its own scroller on the left
role hstack · defaults alignment: "stretch", spacing: 0
Source
NXBrowser() { Text("Content"); Button("Action") }NXColorWell¶
A colour well: a bevelled frame around a colour swatch
role color · arguments color
Source
NXColorWell(.blue).frame(width: 160, height: 96)NXRunAlertPanel¶
An alert panel: title bar, application icon, bold title, message and buttons with the default (return) one on the right
role dialog · arguments title · defaults icon: "Application", variant: "alert"
Source
NXRunAlertPanel("Title") { Text("Content"); Button("Action") }NXSplitView¶
A split view: put Divider() between the panes to get the dimpled divider bar
role vstack · defaults alignment: "stretch", spacing: 0
Source
NXSplitView() { Text("Content"); Button("Action") }NXText¶
A Text object in a ScrollView: white page with the scroller on the left
role textfield · arguments label · defaults kind: "multiline"
Source
NXText("Label")NXWorkspace¶
The Workspace screen: the dark grey backdrop; place Window, Menu and Dock with .position(x:y:) or frames
role canvas
Source
NXWorkspace() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)Panel¶
A panel (inspector, find, info): title bar with the close button only, no resize bar
role card · arguments title · defaults variant: "panel" · variants panel, panelMain, panelInactive
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Panel("Title") { Text("Content"); Button("Action") }.variant("panel"); Text("panel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Panel("Title") { Text("Content"); Button("Action") }.variant("panelMain"); Text("panelMain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Panel("Title") { Text("Content"); Button("Action") }.variant("panelInactive"); Text("panelInactive").font(.caption).foregroundStyle(.secondary) }
}PathView¶
The File Viewer's icon path: a FileIcon per folder of the current path
role hstack · defaults alignment: "top", spacing: 0
Source
PathView() { Text("Content"); Button("Action") }PopUpList¶
A pop-up list: a raised button with the small bar indicator on the right
role select · arguments label
Source
PopUpList("Label")ProgressIndicator¶
A progress bar (OPENSTEP 4): sunken trough with a dark fill
role progress
Source
ProgressIndicator()PullDownList¶
A pull-down list: a raised button with a down arrow
role select · arguments label · defaults variant: "pulldown"
Source
PullDownList("Label")RadioButton¶
A radio button: a round bezel, dark when on
role radio · arguments label
Source
RadioButton("Label")RadioMatrix¶
A Matrix of radio button cells: RadioMatrix("Title", items: […], selection:)
role radiogroup · arguments label
Source
RadioMatrix("Label")ReturnButton¶
The default button of a panel: the return-key glyph after its title
role button · arguments label · defaults variant: "default"
Source
ReturnButton("Label")Ruler¶
The Text ruler: a tick-marked strip with alignment, spacing and tab controls
role toolbar · defaults variant: "ruler"
Source
Ruler() { Button("Save"); Button("Share") }ScrollView¶
A ScrollView with its scroller on the LEFT (NeXT style: knob in a dark trough, both arrows at the bottom)
role scroll
Source
ScrollView() { Text("Content"); Button("Action") }SecureTextField¶
A text field that shows bullets
role textfield · arguments label · defaults kind: "password"
Source
SecureTextField("Label")Shelf¶
The File Viewer's shelf: a row of FileIcons above the browser
role hstack · defaults alignment: "top", spacing: 12
Source
Shelf() { Text("Content"); Button("Action") }Slider¶
A slider: a sunken dark grey trough and a raised knob with a dimple
role slider · arguments label
Source
Slider("Label")SplitView¶
A split view: put Divider() between the panes to get the dimpled divider bar
role vstack · defaults alignment: "stretch", spacing: 0
Source
SplitView() { Text("Content"); Button("Action") }SubmenuItem¶
A menu cell that opens a submenu (the arrow on the right); .selected() while its submenu is attached
role menuitem · arguments label
Source
SubmenuItem("Label")Switch¶
A switch: a small bevelled square that shows a check mark when on
role checkbox · arguments label
Source
Switch("Label")TableView¶
A table view: raised column titles over a white grid (Mail's message list)
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
TableView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])Terminal¶
A Terminal window body (white, monospaced)
role code · arguments code · defaults variant: "terminal"
Source
Terminal("let total = items.count")TextField¶
A bezelled text field (white, sunken)
role textfield · arguments label
Source
TextField("Label")TextView¶
A Text object in a ScrollView: white page with the scroller on the left
role textfield · arguments label · defaults kind: "multiline"
Source
TextView("Label")Title¶
A Helvetica Bold heading
role text · arguments content · defaults font: "title2"
Source
Title("Content")TornOffMenu¶
A submenu torn off and left on screen: its title bar gains a close button
role card · arguments title · defaults variant: "torn"
Source
TornOffMenu("Title") { Text("Content"); Button("Action") }Window¶
A titled window: black title bar when key (.variant(.main) dark grey, .variant(.inactive) light grey), miniaturize button left, close button right, resize bar at the bottom
role card · arguments title · defaults variant: "key" · variants key, main, inactive
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("key"); Text("key").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("main"); Text("main").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Window("Title") { Text("Content"); Button("Action") }.variant("inactive"); Text("inactive").font(.caption).foregroundStyle(.secondary) }
}Workspace¶
The Workspace screen: the dark grey backdrop; place Window, Menu and Dock with .position(x:y:) or frames
role canvas
Source
Workspace() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)Core vocabulary in this style¶
Accordion¶
role accordion · arguments title
Source
Accordion("Title") { Text("Content"); Button("Action") }Alert¶
role dialog · arguments title · defaults variant: "alert"
Source
Alert("Title") { Text("Content"); Button("Action") }Board¶
Kanban board of BoardColumn children
role board
Source
Board() { BoardColumn("To do") { KanbanCard("Write copy") } }BoardColumn¶
BoardColumn("To do", count:, color:) { KanbanCard(…) }
role boardcolumn · arguments title
Source
BoardColumn("Title") { KanbanCard("Write copy"); KanbanCard("Review") }Calendar¶
role calendar
Source
Calendar()Callout¶
a numbered annotation; place with .position(x:y:)
role callout · arguments number, text
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
Source
Canvas() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)Card¶
role card · arguments title
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])CodeBlock¶
role code · arguments code · defaults lineNumbers: False
Source
CodeBlock("let total = items.count")CodeEditor¶
CodeEditor("…", language: "swift", lineNumbers:, highlight: [3], tabs: [..])
role code · arguments code
Source
CodeEditor("let total = items.count")Comment¶
author:, time:, avatar:
role message · arguments text · defaults variant: "comment"
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
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }EmptyState¶
title, systemImage:, description: { actions }
role emptystate · arguments title
Source
EmptyState("Title")Gantt¶
scale: ["W1",…], tasks: [("Design", 0, 2, 0.6), …], today:
role gantt
Source
Gantt(tasks: [("Design", 0, 3), ("Build", 2, 5)])Grid¶
Grid of GridRow children, or columns: n
role grid
Source
Grid() { Text("Content"); Button("Action") }GroupBox¶
role card · arguments title
Source
GroupBox("Title") { Text("Content"); Button("Action") }HStack¶
Horizontal stack. spacing:, alignment: .top|.center|.bottom
role hstack
Source
HStack() { Text("Content"); Button("Action") }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
Source
KanbanCard("Title")LabeledContent¶
role labeled · arguments label, value
Source
LabeledContent("Label", "Value") { Text("Content"); Button("Action") }LazyVGrid¶
columns: [GridItem(.flexible()), …] or a count
role grid
Source
LazyVGrid() { Text("Content"); Button("Action") }List¶
.listStyle(.insetGrouped|.plain|.sidebar|…)
role list
Source
List() { Text("First item"); Text("Second item") }Map¶
pins: [(x%, y%, "label")], route:, showsUserLocation:, height:
role map
Source
Map().frame(width: 160, height: 96)MessageBubble¶
MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])
role message · arguments text
Source
MessageBubble("Text")NavigationLink¶
role listitem · arguments title · defaults chevron: True
Source
NavigationLink("Title")NavigationSplitView¶
{ sidebar } content: { … } detail: { … }
role split
Source
NavigationSplitView() { Text("Content"); Button("Action") }NavigationStack¶
Content's .navigationTitle / .toolbar form the bar
role navstack
Source
NavigationStack() { Text("Content"); Button("Action") }Picker¶
Picker("Size", selection: "M") { Text("S") … }
role select · arguments label
Source
Picker("Label")Placeholder¶
A labelled box for maps, charts, media
role placeholder · arguments 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
Source
ProgressView("Label")RoundedRectangle¶
role shape · defaults shape: "rounded"
Source
RoundedRectangle().frame(width: 160, height: 96)Row¶
title, subtitle:, detail:, systemImage:, chevron:
role listitem · arguments title
Source
Row("Title")Schedule¶
days: [..], startHour:, endHour:, events: [("Standup", "Mon", 9, 9.5, .blue)], now:
role schedule
Source
Schedule()SearchField¶
role textfield · arguments placeholder · defaults kind: "search"
Source
SearchField("Placeholder")Section¶
Section("Header") { … } footer: { … }
role section · arguments title
Source
Section("Title") { Text("First item"); Text("Second item") }SecureField¶
role textfield · arguments placeholder · defaults kind: "password"
Source
SecureField("Placeholder")SegmentedControl¶
role segmented · arguments items
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") }Sidebar¶
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)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
| A | B | |
|---|---|---|
| 1 | A | B |
| 2 | 1 | 2 |
| 3 | 3 | 4 |
Source
Spreadsheet(columns: ["A", "B"], rows: [[1, 2], [3, 4]])Stat¶
Stat("Revenue", "$48k", change: "+12%", trend: [..], systemImage:)
role stat · arguments label, value
Source
Stat("Label", 60)Steps¶
role steps · arguments steps
Source
Steps(["Cart", "Shipping", "Payment"])StickyNote¶
StickyNote("Call Ana", color: .yellow, rotation: -2, author:)
role stickynote · arguments text
Source
StickyNote("Text")TabView¶
Children with .tabItem { Label } or Tab(…)
role tabs · defaults placement: "bottom"
Source
TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }Table¶
columns: ["Name", …], rows: [[…], …] or TableRow children
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])Tabs¶
role tabs · arguments items · defaults placement: "top"
Source
Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }Text¶
Text with bold, italic, code Markdown
role text · arguments content
Source
Text("Content")TextEditor¶
role textfield · arguments text · defaults kind: "multiline"
Source
TextEditor("Text")Timeline¶
role timeline
Source
Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }TimelineItem¶
title, time:, description:, systemImage:, status:
role timelineitem · arguments title
Source
TimelineItem("Title")ToolbarItem¶
ToolbarItem(placement: .topBarTrailing) { … }
role toolbaritem
Source
ToolbarItem() { Text("Content"); Button("Action") }ToolbarItemGroup¶
role toolbaritem
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }Tooltip¶
role tooltip · arguments text
Source
Tooltip("Text") { Text("Content"); Button("Action") }Tree¶
Tree { TreeItem("src") { TreeItem("main.swift") } }
role tree
Source
Tree() { TreeItem("Folder") { TreeItem("File") } }TreeItem¶
label, systemImage:, folder:, expanded:, selected:, detail:
role treeitem · arguments label
Source
TreeItem("Label")VStack¶
Vertical stack. spacing:, alignment: .leading|.center|.trailing
role vstack
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"
Source
Whiteboard() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)ZStack¶
Overlapping layers. alignment:
role zstack
Source
ZStack() { Text("Content"); Button("Action") }