Qt Widgets (Fusion)¶
Imitates: Qt 6 Widgets · Fusion style (cross-platform default palette) Qt 6.8 · Pack id: qt · Selected by: pack="qt", import Qt, import QtWidgets, import Qt6, import PySide, import PyQt · Default device: desktop (windows chrome)
76 own elements, plus 128 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¶
Action¶
QAction("&Open…", icon:, shortcut: "Ctrl+O", checked:) — children make a submenu
role menuitem · arguments label
Source
Action("Label")BasicColors¶
QColorDialog basic-colour grid: colors: [..], selection:
role swatches · defaults variant: "basicColors"
Source
BasicColors()ButtonGroup¶
Exclusive group of RadioButtons: items:, selection:
role radiogroup · arguments label
Source
ButtonGroup("Label")CalendarWidget¶
QCalendarWidget(selectedDate: "2026-11-23") — highlight-coloured navigation bar
role calendar · defaults firstWeekday: 1
Source
CalendarWidget()CentralWidget¶
The main window's central widget; give it .frame(maxWidth: .infinity, maxHeight: .infinity)
role vstack · defaults alignment: "stretch", spacing: 6
Source
CentralWidget() { Text("Content"); Button("Action") }ChartView¶
QChartView(kind: .bar|.line|.pie|…, series:, labels:) — Qt Charts light/dark themes
role chart
Source
ChartView(values: [3, 5, 2, 6, 4])CheckBox¶
QCheckBox("Option", checked: true|.indeterminate)
role checkbox · arguments label
Source
CheckBox("Label")ColorDialog¶
QColorDialog window
role dialog · arguments title · defaults closable: True, variant: "colorDialog"
Source
ColorDialog("Title") { Text("Content"); Button("Action") }ComboBox¶
QComboBox(items: [..], currentText:, editable:)
role select · arguments label
Source
ComboBox("Label")CommandLinkButton¶
QCommandLinkButton("Install now")
role button · arguments label · defaults icon: "arrow.right", variant: "commandLink"
Source
CommandLinkButton("Label")DateEdit¶
QDateEdit(date: "2026-11-23", calendarPopup: true)
role datepicker · arguments date · defaults format: "numeric"
Source
DateEdit("2026-11-24")DateTimeEdit¶
QDateTimeEdit(dateTime: "2026-11-23 14:30")
role datepicker · arguments dateTime · defaults format: "numeric", kind: "datetime"
Source
DateTimeEdit()Dial¶
QDial(value: 40, maximum: 100)
role progress · arguments value · defaults kind: "circular"
Source
Dial(60)Dialog¶
QDialog("Title") { … } actions: { DialogButtonBox… } — a window with its own title bar
role dialog · arguments title · defaults closable: True
Source
Dialog("Title") { Text("Content"); Button("Action") }DialogButtonBox¶
QDialogButtonBox { PushButton("OK", default: true); PushButton("Cancel") } — right-aligned
role hstack · defaults spacing: 6, variant: "buttonBox"
Source
DialogButtonBox() { Text("Content"); Button("Action") }DockWidget¶
QDockWidget("Title") { … } — title bar with float and close buttons
role card · arguments title · defaults variant: "dock"
Source
DockWidget("Title") { Text("Content"); Button("Action") }DoubleSpinBox¶
QDoubleSpinBox(value: 1.50, suffix:)
role textfield · arguments value · defaults kind: "spin"
Source
DoubleSpinBox("Value")FileDialog¶
QFileDialog window (compose its contents)
role dialog · arguments title · defaults closable: True, variant: "fileDialog"
Source
FileDialog("Title") { Text("Content"); Button("Action") }FontComboBox¶
QFontComboBox(currentText:)
role select · arguments label · defaults selection: "Segoe UI"
Source
FontComboBox("Label")FontDialog¶
QFontDialog window
role dialog · arguments title · defaults closable: True, variant: "fontDialog"
Source
FontDialog("Title") { Text("Content"); Button("Action") }FormLayout¶
QFormLayout { FormRow("Name:") { LineEdit() } } — labels right-aligned in the first column
role form · defaults variant: "formLayout" · variants formLayout, leadingLabels
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { FormLayout() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("formLayout"); Text("formLayout").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { FormLayout() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("leadingLabels"); Text("leadingLabels").font(.caption).foregroundStyle(.secondary) }
}FormRow¶
QFormLayout::addRow(label, field): FormRow("Name:") { LineEdit() }
role labeled · arguments label
Source
FormRow("Label") { Text("Content"); Button("Action") }Frame¶
QFrame(frameShape: .box|.panel|.styledPanel|.hLine|.vLine|.noFrame, frameShadow: .sunken|.raised|.plain)
role vstack · defaults alignment: "stretch", variant: "styledPanel" · variants styledPanel, box, panel, winPanel, hLine, vLine, noFrame
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("styledPanel"); Text("styledPanel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("box"); Text("box").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("panel"); Text("panel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("winPanel"); Text("winPanel").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("hLine"); Text("hLine").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("vLine"); Text("vLine").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Frame() { Text("Content"); Button("Action") }.variant("noFrame"); Text("noFrame").font(.caption).foregroundStyle(.secondary) }
}GridLayout¶
QGridLayout(columns: n) or GridRow children
role grid
Source
GridLayout() { Text("Content"); Button("Action") }GroupBox¶
QGroupBox("Title", checkable: true, checked: true) { … } — bold title above a rounded frame
role card · arguments title · variants flat
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { GroupBox("Title") { Text("Content"); Button("Action") }.variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
}HBoxLayout¶
QHBoxLayout: children left to right
role hstack · defaults spacing: 6
Source
HBoxLayout() { Text("Content"); Button("Action") }HeaderView¶
QHeaderView(["Name", "Size"], selection: sorted section)
role segmented · arguments items
Source
HeaderView(["One", "Two", "Three"])InputDialog¶
QInputDialog window
role dialog · arguments title · defaults closable: True, variant: "inputDialog"
Source
InputDialog("Title") { Text("Content"); Button("Action") }KeySequenceEdit¶
QKeySequenceEdit(keySequence: "Ctrl+Shift+S")
role textfield · arguments keySequence
Source
KeySequenceEdit("Ctrl+S")LCDNumber¶
QLCDNumber("128.4", segmentStyle: .filled)
role text · arguments content · defaults variant: "outline" · variants outline, filled, flat
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { LCDNumber("Content").variant("outline"); Text("outline").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { LCDNumber("Content").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { LCDNumber("Content").variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
}LineEdit¶
QLineEdit("text", placeholderText:, echoMode: .password, clearButtonEnabled:)
role textfield · arguments text
Source
LineEdit("Text")ListView¶
QListView { ListWidgetItem… }
role list
Source
ListView() { Text("First item"); Text("Second item") }ListWidget¶
QListWidget { ListWidgetItem("Item", icon:) … } — select with .selected()
role list
Source
ListWidget() { Text("First item"); Text("Second item") }ListWidgetItem¶
ListWidgetItem("Text", icon:, checked:)
role listitem · arguments title
Source
ListWidgetItem("Title")MainWindow¶
QMainWindow: stack MenuBar, ToolBar, the central area (DockWidgets + central widget in an HStack/Splitter) and StatusBar
role vstack · defaults alignment: "stretch", spacing: 0
Source
MainWindow() { Text("Content"); Button("Action") }MdiArea¶
QMdiArea: place MdiSubWindow children with .position(x:y:)
role canvas
Source
MdiArea() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)MdiSubWindow¶
QMdiSubWindow("Title") { … }
role card · arguments title · defaults variant: "mdi"
Source
MdiSubWindow("Title") { Text("Content"); Button("Action") }Menu¶
QMenu: in a MenuBar a title (open: true shows it); without a label a standalone popup / context menu
role menu · arguments label · defaults caret: False
Source
Menu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MenuBar¶
QMenuBar { Menu("&File") { Action… } }
role toolbar · defaults variant: "menuBar"
Source
MenuBar() { Button("Save"); Button("Share") }MessageBox¶
QMessageBox("Title", text:, icon: .warning|.information|.critical|.question, buttons: [..], primary:) { informative text }
role dialog · arguments title · defaults closable: True, variant: "messageBox"
Source
MessageBox("Title") { Text("Content"); Button("Action") }PlainTextEdit¶
QPlainTextEdit(plainText:)
role textfield · arguments text · defaults kind: "multiline", rows: 6
Source
PlainTextEdit("Text")ProgressBar¶
QProgressBar(value: 64) — percentage in the bar; no value = busy
role progress · arguments value · defaults showValue: True
Source
ProgressBar(60)ProgressDialog¶
QProgressDialog window
role dialog · arguments title · defaults closable: True, variant: "progressDialog"
Source
ProgressDialog("Title") { Text("Content"); Button("Action") }PushButton¶
QPushButton("OK", default: true, icon:, checked:, flat:, menu:)
role button · arguments label · variants default, flat
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("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
}RadioButton¶
QRadioButton("Option", checked: true)
role radio · arguments label
Source
RadioButton("Label")RubberBand¶
QRubberBand: a selection rectangle (size with .frame, place with .position)
role marquee
Source
RubberBand()ScrollArea¶
QScrollArea with Fusion scroll bars
role scroll · arguments axes
Source
ScrollArea() { Text("Content"); Button("Action") }ScrollBar¶
QScrollBar(value: 30, orientation: .horizontal)
role slider · arguments value · defaults orientation: "horizontal"
Source
ScrollBar(60)Slider¶
QSlider(value: 40, minimum: 0, maximum: 100, tickPosition: .ticksBelow)
role slider · arguments value
Source
Slider(60)SpinBox¶
QSpinBox(value: 3, prefix:, suffix: " px") — up/down buttons at the right
role textfield · arguments value · defaults kind: "spin"
Source
SpinBox("Value")Splitter¶
QSplitter(orientation: .horizontal|.vertical) — panes separated by a handle; size panes with .frame(width:)
role hstack · defaults spacing: 0
Source
Splitter() { Text("Content"); Button("Action") }StackedLayout¶
role vstack · defaults alignment: "stretch"
Source
StackedLayout() { Text("Content"); Button("Action") }StackedWidget¶
QStackedWidget: holds the current page only
role vstack · defaults alignment: "stretch"
Source
StackedWidget() { Text("Content"); Button("Action") }StatusBar¶
QStatusBar { Label("Ready"); Spacer(); Label("Ln 1, Col 1") } — size grip at the right
role toolbar · defaults variant: "statusBar"
Source
StatusBar() { Button("Save"); Button("Share") }TabBar¶
QTabBar(items: [..], selection:)
role tabs · arguments items · defaults placement: "top", variant: "tabBar"
Source
TabBar(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }TabWidget¶
QTabWidget(selection:) { Tab("General") { … } } — tabsClosable:, documentMode via .variant(.documentMode)
role tabs · defaults placement: "top", variant: "tabWidget" · variants tabWidget, documentMode
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { TabWidget() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("tabWidget"); Text("tabWidget").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TabWidget() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("documentMode"); Text("documentMode").font(.caption).foregroundStyle(.secondary) }
}TableView¶
QTableView(columns:, rows:, selection:, sortColumn:) — .variant(.noVerticalHeader) hides row numbers
role table · defaults variant: "verticalHeader" · variants verticalHeader, noVerticalHeader
| 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) { TableView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("verticalHeader"); Text("verticalHeader").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TableView(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("noVerticalHeader"); Text("noVerticalHeader").font(.caption).foregroundStyle(.secondary) }
}TableWidget¶
QTableWidget(columns: [..], rows: [[..]], selection: [row], alternatingRowColors:) — row numbers on the left
role table · defaults variant: "verticalHeader" · variants verticalHeader, noVerticalHeader
| 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) { TableWidget(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("verticalHeader"); Text("verticalHeader").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TableWidget(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("noVerticalHeader"); Text("noVerticalHeader").font(.caption).foregroundStyle(.secondary) }
}TextBrowser¶
QTextBrowser(html:) — read-only rich text
role textfield · arguments text · defaults kind: "multiline", rows: 6
Source
TextBrowser("Text")TextEdit¶
QTextEdit("rich text", rows:) — rich text editor
role textfield · arguments text · defaults kind: "multiline", rows: 6
Source
TextEdit("Text")TimeEdit¶
QTimeEdit(time: "14:30")
role datepicker · arguments time · defaults kind: "time"
Source
TimeEdit("09:41")ToolBar¶
QToolBar { ToolButton(icon:) … Separator() }
role toolbar · defaults variant: "toolBar"
Source
ToolBar() { Button("Save"); Button("Share") }ToolBox¶
QToolBox { ToolBoxItem("Page", expanded: true) { … } }
role vstack · defaults alignment: "stretch", spacing: 0
Source
ToolBox() { Text("Content"); Button("Action") }ToolBoxItem¶
One QToolBox page: tab button + (expanded) contents
role accordion · arguments title
Source
ToolBoxItem("Title") { Text("Content"); Button("Action") }ToolButton¶
QToolButton("Save", icon: "document-save", toolButtonStyle: .textUnderIcon|.textBesideIcon|.iconOnly, checked:, popupMode:)
role button · arguments label · defaults variant: "toolButton"
Source
ToolButton("Label")ToolTip¶
QToolTip shown over its child
role tooltip · arguments text
Source
ToolTip("Text") { Text("Content"); Button("Action") }TreeView¶
QTreeView { HeaderView([…]); TreeWidgetItem… }
role tree
Source
TreeView() { TreeItem("Folder") { TreeItem("File") } }TreeWidget¶
QTreeWidget { HeaderView(["Name", "Size"]); TreeWidgetItem("src") { … } }
role tree
Source
TreeWidget() { TreeItem("Folder") { TreeItem("File") } }TreeWidgetItem¶
TreeWidgetItem("Name", icon:, expanded:) { Text("col 2") … TreeWidgetItem(…) } — Text children are extra columns
role treeitem · arguments label
Source
TreeWidgetItem("Label")VBoxLayout¶
QVBoxLayout: children top to bottom
role vstack · defaults alignment: "stretch", spacing: 6
Source
VBoxLayout() { Text("Content"); Button("Action") }Widget¶
QWidget: a plain container (vertical)
role vstack · defaults alignment: "leading"
Source
Widget() { Text("Content"); Button("Action") }Wizard¶
QWizard window holding one WizardPage
role dialog · arguments title · defaults closable: True, variant: "wizard"
Source
Wizard("Title") { Text("Content"); Button("Action") }WizardPage¶
QWizardPage("Title", subtitle:) { … } — white header band
role card · arguments title · defaults variant: "wizardPage"
Source
WizardPage("Title") { Text("Content"); Button("Action") }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") }Button¶
Button("Save", systemImage:) · .buttonStyle(…)
role button · arguments label
Source
Button("Label")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")DisclosureGroup¶
role accordion · arguments title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }EmptyState¶
title, systemImage:, description: { actions }
role emptystate · arguments title
Source
EmptyState("Title")Form¶
role form
Source
Form() { TextField("Name"); Toggle("Notifications", isOn: true) }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") }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()ScrollView¶
role scroll · arguments axes
Source
ScrollView() { Text("Content"); Button("Action") }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") } }Terminal¶
lines starting with "$ " are commands
role code · arguments code · defaults variant: "terminal"
Source
Terminal("let total = items.count")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")TextField¶
TextField("Placeholder", text: "value")
role textfield · arguments placeholder
Source
TextField("Placeholder")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") }