SwiftUI¶
Imitates: SwiftUI · iOS 26, iPadOS 26, macOS 26 (Liquid Glass) iOS 26 SDK · Pack id: swiftui · Selected by: pack="swiftui", import SwiftUI · Default device: phone (ios chrome)
86 own elements, plus 89 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¶
ActionSheet¶
Deprecated action sheet
role dialog · arguments title · defaults variant: "action-sheet"
Source
ActionSheet("Title") { Text("Content"); Button("Action") }Alert¶
Alert("Delete?", message: "…") { Button("Cancel", role: .cancel) … } — prefer .alert(…)
role dialog · arguments title · defaults variant: "alert"
Source
Alert("Title") { Text("Content"); Button("Action") }AnyView¶
Type-erased wrapper
role group
Source
AnyView() { Text("Content"); Button("Action") }AreaMark¶
An area chart: AreaMark(values: [..], labels: [..])
role chart · defaults kind: "area"
Source
AreaMark(values: [3, 5, 2, 6, 4])AsyncImage¶
AsyncImage(url: "photo.jpg")
role image · arguments url
Source
AsyncImage().frame(width: 160, height: 96)BarMark¶
A bar chart: BarMark(values: [..], labels: [..])
role chart · defaults kind: "bar"
Source
BarMark(values: [3, 5, 2, 6, 4])Button¶
Button("Save", systemImage:, role: .destructive|.cancel) · .buttonStyle(.bordered|.borderedProminent|.glass|.glassProminent) · .controlSize(.small|.large)
role button · arguments label · variants automatic, borderless, plain, bordered, borderedProminent, glass, glassProminent, link, accessoryBar, accessoryBarAction, card
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("borderless"); Text("borderless").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("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("borderedProminent"); Text("borderedProminent").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("glass"); Text("glass").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("glassProminent"); Text("glassProminent").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("link"); Text("link").font(.caption).foregroundStyle(.secondary) }
}Canvas¶
Canvas drawing placeholder
role placeholder · arguments label
Source
Canvas("Label").frame(width: 160, height: 96)Card¶
Not SwiftUI: a rounded content tile like GroupBox
role card · arguments title
Source
Card("Title") { Text("Content"); Button("Action") }Chart¶
Swift Charts: Chart(kind: .bar|.line|.area|.pie|.donut, values: [..], labels: [..]) or series: [[..], [..]]
role chart · variants bar, line, area, pie, donut, sparkline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("bar"); Text("bar").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("line"); Text("line").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("area"); Text("area").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("pie"); Text("pie").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("donut"); Text("donut").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Chart(values: [3, 5, 2, 6, 4]).variant("sparkline"); Text("sparkline").font(.caption).foregroundStyle(.secondary) }
}ColorPicker¶
ColorPicker("Tint", selection: .blue) — label with the rainbow colour well
role labeled · arguments label
Source
ColorPicker("Label") { Text("Content"); Button("Action") }ConcentricRectangle¶
iOS 26 concentric shape
role shape · defaults shape: "rounded"
Source
ConcentricRectangle().frame(width: 160, height: 96)ConfirmationDialog¶
Action sheet; prefer .confirmationDialog(…)
role dialog · arguments title · defaults variant: "action-sheet"
Source
ConfirmationDialog("Title") { Text("Content"); Button("Action") }ContainerRelativeShape¶
role shape · defaults shape: "rounded"
Source
ContainerRelativeShape().frame(width: 160, height: 96)ContentUnavailableView¶
ContentUnavailableView("No Mail", systemImage: "tray", description: Text("…")) { actions }
role dialog · arguments title · defaults inline: True, variant: "unavailable"
Source
ContentUnavailableView("Title") { Text("Content"); Button("Action") }ControlGroup¶
ControlGroup { Button … } — joined capsule of buttons
role toolbar · defaults variant: "group" · variants automatic, navigation, palette, compactMenu, menu
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ControlGroup() { Button("Save"); Button("Share") }.variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ControlGroup() { Button("Save"); Button("Share") }.variant("navigation"); Text("navigation").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ControlGroup() { Button("Save"); Button("Share") }.variant("palette"); Text("palette").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ControlGroup() { Button("Save"); Button("Share") }.variant("compactMenu"); Text("compactMenu").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ControlGroup() { Button("Save"); Button("Share") }.variant("menu"); Text("menu").font(.caption).foregroundStyle(.secondary) }
}DatePicker¶
DatePicker("Starts", selection: "2026-11-23") — compact grey capsule; .datePickerStyle(.graphical) for the calendar
role datepicker · arguments label · variants automatic, compact, graphical, wheel, field, stepperField
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("compact"); Text("compact").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("graphical"); Text("graphical").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("wheel"); Text("wheel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("field"); Text("field").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { DatePicker("Label").variant("stepperField"); Text("stepperField").font(.caption).foregroundStyle(.secondary) }
}DisclosureGroup¶
DisclosureGroup("Advanced", isExpanded: true) { … }
role accordion · arguments title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }EditButton¶
Toggles a list's edit mode — plain accent text
role button · arguments label · defaults label: "Edit"
Source
EditButton()EmptyView¶
Renders nothing
role group
Source
EmptyView() { Text("Content"); Button("Action") }Form¶
Form { Section { TextField … Toggle … } } — inset-grouped rows
role form · defaults variant: "grouped" · variants automatic, grouped, columns
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("grouped"); Text("grouped").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("columns"); Text("columns").font(.caption).foregroundStyle(.secondary) }
}Gauge¶
Gauge(value: 0.7, label: { Text("BPM") }, currentValueLabel: { Text("72") }) · .gaugeStyle(…)
role progress · arguments value · defaults variant: "accessoryCircular" · variants automatic, accessoryCircular, accessoryCircularCapacity, accessoryLinear, accessoryLinearCapacity, linearCapacity
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("accessoryCircular"); Text("accessoryCircular").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("accessoryCircularCapacity"); Text("accessoryCircularCapacity").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("accessoryLinear"); Text("accessoryLinear").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("accessoryLinearCapacity"); Text("accessoryLinearCapacity").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Gauge(60).variant("linearCapacity"); Text("linearCapacity").font(.caption).foregroundStyle(.secondary) }
}GeometryReader¶
Transparent container (stacked)
role vstack
Source
GeometryReader() { Text("Content"); Button("Action") }GlassEffectContainer¶
iOS 26: groups glass shapes; renders as an HStack
role hstack
Source
GlassEffectContainer() { Text("Content"); Button("Action") }GroupBox¶
GroupBox("Activity") { … } — rounded secondary-background box
role card · arguments title
Source
GroupBox("Title") { Text("Content"); Button("Action") }HSplitView¶
macOS horizontal split
role hstack
Source
HSplitView() { Text("Content"); Button("Action") }HelpLink¶
macOS round help (?) button
role button · defaults iconOnly: True, systemImage: "questionmark", variant: "help"
Source
HelpLink()Image¶
Image("asset.png") or Image(systemName: "star.fill")
role image · arguments name
Source
Image().frame(width: 160, height: 96)Inspector¶
Inline inspector panel content (prefer the .inspector modifier)
role card · arguments title
Source
Inspector("Title") { Text("Content"); Button("Action") }Label¶
Label("Inbox", systemImage: "tray"); .labelStyle(.iconOnly|.titleOnly|.titleAndIcon)
role label · arguments title
Source
Label("Title")LabeledContent¶
LabeledContent("Version", value: "26.1") — label + secondary value
role labeled · arguments label, value
Source
LabeledContent("Label", "Value") { Text("Content"); Button("Action") }LineMark¶
A line chart: LineMark(values: [..], labels: [..])
role chart · defaults kind: "line"
Source
LineMark(values: [3, 5, 2, 6, 4])Link¶
Link("Privacy Policy", destination: url) — accent text
role link · arguments label, destination
Source
Link("Label")List¶
List { Section("…") { … } } — inset-grouped by default; .listStyle(.plain|.sidebar|.grouped)
role list · defaults variant: "insetGrouped" · variants automatic, insetGrouped, grouped, inset, plain, sidebar, bordered
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("insetGrouped"); Text("insetGrouped").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("grouped"); Text("grouped").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("inset"); Text("inset").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("sidebar"); Text("sidebar").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
}Map¶
MapKit map placeholder (streets, park, water, pin)
role placeholder · arguments label · defaults systemImage: "mappin"
Source
Map("Label").frame(width: 160, height: 96)Menu¶
Menu("Sort", systemImage:) { Button … } · open: true shows the glass menu
role menu · arguments label
Source
Menu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MultiDatePicker¶
MultiDatePicker("Dates", selection:) — calendar with several marked days (events:)
role calendar · arguments label
Source
MultiDatePicker("Label")NavigationLink¶
NavigationLink("General", systemImage: "gear", iconColor: .gray) — row with chevron
role listitem · arguments title · defaults chevron: True
Source
NavigationLink("Title")NavigationSplitView¶
NavigationSplitView { sidebar } content: { … } detail: { … }
role split · variants automatic, balanced, prominentDetail
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NavigationSplitView() { Text("Content"); Button("Action") }.variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationSplitView() { Text("Content"); Button("Action") }.variant("balanced"); Text("balanced").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationSplitView() { Text("Content"); Button("Action") }.variant("prominentDetail"); Text("prominentDetail").font(.caption).foregroundStyle(.secondary) }
}NavigationStack¶
NavigationStack { … .navigationTitle("Title") .toolbar { … } } · back: "Settings" shows the glass back button
role navstack
Source
NavigationStack() { Text("Content"); Button("Action") }NavigationView¶
Deprecated alias of NavigationStack
role navstack
Source
NavigationView() { Text("Content"); Button("Action") }OutlineGroup¶
Hierarchical rows; written here as a DisclosureGroup-like node: OutlineGroup("Folder", isExpanded: true) { … }
role accordion · arguments title
Source
OutlineGroup("Title") { Text("Content"); Button("Action") }PasteButton¶
System paste button (bordered capsule)
role button · arguments label · defaults label: "Paste", systemImage: "doc.on.clipboard", variant: "bordered"
Source
PasteButton()PhotosPicker¶
PhotosPicker("Select Photos", selection:) — opens the photo picker
role button · arguments label · defaults label: "Select Photos", systemImage: "photo"
Source
PhotosPicker()Picker¶
Picker("Sort", selection: "Date") { Text("Date") … } · .pickerStyle(.segmented|.inline|.navigationLink)
role select · arguments label · defaults variant: "menu" · variants automatic, menu, segmented, inline, radioGroup, wheel, navigationLink, palette
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("menu"); Text("menu").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("segmented"); Text("segmented").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("radioGroup"); Text("radioGroup").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("wheel"); Text("wheel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("navigationLink"); Text("navigationLink").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Picker("Label").variant("palette"); Text("palette").font(.caption).foregroundStyle(.secondary) }
}PointMark¶
A point/line chart: PointMark(values: [..])
role chart · defaults kind: "line"
Source
PointMark(values: [3, 5, 2, 6, 4])Popover¶
Popover bubble; prefer .popover(isPresented:)
role dialog · arguments title · defaults variant: "popover"
Source
Popover("Title") { Text("Content"); Button("Action") }ProgressView¶
ProgressView() spinner, or ProgressView("Uploading", value: 0.4)
role progress · arguments label · variants automatic, linear, circular
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ProgressView("Label").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProgressView("Label").variant("linear"); Text("linear").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProgressView("Label").variant("circular"); Text("circular").font(.caption).foregroundStyle(.secondary) }
}RealityView¶
RealityKit view placeholder
role placeholder · arguments label · defaults systemImage: "cube"
Source
RealityView("Label").frame(width: 160, height: 96)RenameButton¶
Triggers a rename action
role button · arguments label · defaults label: "Rename", systemImage: "pencil"
Source
RenameButton()Row¶
Generic row: title, subtitle:, detail:, systemImage:, iconColor:, chevron:
role listitem · arguments title
Source
Row("Title")SceneView¶
SceneKit / RealityKit view placeholder
role placeholder · arguments label · defaults systemImage: "cube"
Source
SceneView("Label").frame(width: 160, height: 96)ScrollView¶
ScrollView { … } or ScrollView(.horizontal) { … }
role scroll · arguments axes
Source
ScrollView() { Text("Content"); Button("Action") }ScrollViewReader¶
Transparent container
role group
Source
ScrollViewReader() { Text("Content"); Button("Action") }Section¶
Section("Header") { … } footer: { Text("…") }
role section · arguments title
Source
Section("Title") { Text("First item"); Text("Second item") }SectorMark¶
A donut chart: SectorMark(values: [..], labels: [..])
role chart · defaults kind: "donut"
Source
SectorMark(values: [3, 5, 2, 6, 4])SecureField¶
SecureField("Password", text: $password)
role textfield · arguments placeholder · defaults kind: "password" · variants automatic, plain, roundedBorder
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { SecureField("Placeholder").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { SecureField("Placeholder").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { SecureField("Placeholder").variant("roundedBorder"); Text("roundedBorder").font(.caption).foregroundStyle(.secondary) }
}SettingsLink¶
macOS button that opens the Settings window
role button · arguments label · defaults label: "Settings…"
Source
SettingsLink()ShareLink¶
ShareLink(item: url) — share-sheet button
role button · arguments label · defaults label: "Share", systemImage: "square.and.arrow.up"
Source
ShareLink()Sheet¶
Bottom sheet; prefer .sheet(isPresented:) { … }
role dialog · arguments title · defaults variant: "sheet"
Source
Sheet("Title") { Text("Content"); Button("Action") }SignInWithAppleButton¶
AuthenticationServices button — black capsule (white in dark)
role button · arguments label · defaults label: "Sign in with Apple", variant: "signInWithApple"
Source
SignInWithAppleButton()Slider¶
Slider(value: 0.4) { Text("Volume") } minimumValueLabel: { Image(systemName: "speaker") } …
role slider
Source
Slider()SpriteView¶
SpriteKit scene placeholder
role placeholder · arguments label · defaults systemImage: "sparkles"
Source
SpriteView("Label").frame(width: 160, height: 96)Stepper¶
Stepper("Guests", value: 2) — −/+ capsule
role stepper · arguments label
Source
Stepper("Label")Tab¶
Tab("Search", systemImage: "magnifyingglass") { … } · .badge(3)
role tab · arguments label
Source
Tab("Label")TabSection¶
A group of Tabs (sidebar-adaptable TabView)
role section · arguments title
Source
TabSection("Title") { Text("First item"); Text("Second item") }TabView¶
TabView { Tab("Home", systemImage: "house") { … } } — floating Liquid Glass tab bar
role tabs · defaults placement: "bottom" · variants automatic, page, sidebarAdaptable, tabBarOnly
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("page"); Text("page").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("sidebarAdaptable"); Text("sidebarAdaptable").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("tabBarOnly"); Text("tabBarOnly").font(.caption).foregroundStyle(.secondary) }
}Table¶
Table(columns: ["Name", "Size"], rows: [[…]]) or TableColumn / TableRow children — macOS/iPadOS table
role table · variants automatic, inset, bordered
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("inset"); Text("inset").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
}Text¶
Text("Hello") with bold, italic, code; .font(.headline) etc.
role text · arguments content
Source
Text("Content")TextEditor¶
TextEditor(text: $notes) — multi-line editor
role textfield · arguments text · defaults kind: "multiline"
Source
TextEditor("Text")TextField¶
TextField("Email", text: $email); plain in a Form, .textFieldStyle(.roundedBorder) elsewhere; axis: .vertical
role textfield · arguments placeholder · variants automatic, plain, roundedBorder
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { TextField("Placeholder").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TextField("Placeholder").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TextField("Placeholder").variant("roundedBorder"); Text("roundedBorder").font(.caption).foregroundStyle(.secondary) }
}TimelineView¶
Transparent container
role group
Source
TimelineView() { Text("Content"); Button("Action") }TipView¶
TipKit tip: TipView("Favorites", message: "Tap the star…")
role alert · arguments title · defaults closable: True, systemImage: "lightbulb"
Source
TipView("Title")Toggle¶
Toggle("Wi-Fi", isOn: true) — 51×31 green switch; .toggleStyle(.button|.checkbox)
role toggle · arguments label · variants automatic, switch, button, checkbox
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Toggle("Label").variant("automatic"); Text("automatic").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Toggle("Label").variant("switch"); Text("switch").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Toggle("Label").variant("button"); Text("button").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Toggle("Label").variant("checkbox"); Text("checkbox").font(.caption).foregroundStyle(.secondary) }
}Toolbar¶
Not SwiftUI: an inline bar of controls
role toolbar
Source
Toolbar() { Button("Save"); Button("Share") }ToolbarItem¶
ToolbarItem(placement: .topBarTrailing|.topBarLeading|.principal|.bottomBar) { … }
role toolbaritem
Source
ToolbarItem() { Text("Content"); Button("Action") }ToolbarItemGroup¶
ToolbarItemGroup(placement: .bottomBar) { … }
role toolbaritem
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }ToolbarSpacer¶
iOS 26: separates toolbar glass groups (.fixed / .flexible)
role spacer
Source
ToolbarSpacer()UnevenRoundedRectangle¶
role shape · defaults shape: "rounded"
Source
UnevenRoundedRectangle().frame(width: 160, height: 96)VSplitView¶
macOS vertical split
role vstack
Source
VSplitView() { Text("Content"); Button("Action") }VideoPlayer¶
AVKit video placeholder with play button
role placeholder · arguments label · defaults systemImage: "play"
Source
VideoPlayer("Label").frame(width: 160, height: 96)ViewThatFits¶
Renders all candidates; keep one child
role group
Source
ViewThatFits() { Text("Content"); Button("Action") }WebView¶
iOS 26 SwiftUI WebView placeholder
role placeholder · arguments label · defaults systemImage: "globe"
Source
WebView("Label").frame(width: 160, height: 96)WindowGroup¶
Scene wrapper, accepted so App code pastes
role group
Source
WindowGroup() { Text("Content"); Button("Action") }Core vocabulary in this style¶
Accordion¶
role accordion · arguments title
Source
Accordion("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])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")Dialog¶
role dialog · arguments title
Source
Dialog("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") }HStack¶
Horizontal stack. spacing:, alignment: .top|.center|.bottom
role hstack
Source
HStack() { Text("Content"); Button("Action") }KanbanCard¶
title, description:, tags: [..], assignees: [..], due:, comments:, priority:
role kanbancard · arguments title
Source
KanbanCard("Title")LazyVGrid¶
columns: [GridItem(.flexible()), …] or a count
role grid
Source
LazyVGrid() { Text("Content"); Button("Action") }MessageBubble¶
MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])
role message · arguments text
Source
MessageBubble("Text")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)RoundedRectangle¶
role shape · defaults shape: "rounded"
Source
RoundedRectangle().frame(width: 160, height: 96)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")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()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")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") } }Terminal¶
lines starting with "$ " are commands
role code · arguments code · defaults variant: "terminal"
Source
Terminal("let total = items.count")Timeline¶
role timeline
Source
Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }TimelineItem¶
title, time:, description:, systemImage:, status:
role timelineitem · arguments title
Source
TimelineItem("Title")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") }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") }