Angular Material¶
Imitates: Angular Material · Material 3 (azure theme) Angular Material 20 · Pack id: angular-material · Selected by: pack="angular-material", import AngularMaterial, import Angular · Default device: desktop (browser chrome)
93 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¶
MatAccordion¶
mat-accordion: MatExpansionPanel children
role vstack · defaults alignment: "stretch", spacing: 0
Source
MatAccordion() { Text("Content"); Button("Action") }MatActionList¶
mat-action-list: rows that are buttons
role list
Source
MatActionList() { Text("First item"); Text("Second item") }MatAutocomplete¶
input with matAutocomplete: value: (typed text), options:, open: true
role select · arguments label · defaults variant: "fill"
Source
MatAutocomplete("Label")MatBadge¶
matBadge content (usually .badge(n) on a button or icon)
role badge · arguments text
Source
MatBadge("Text")MatBottomSheet¶
MatBottomSheet content: list or actions
role dialog · arguments title · defaults variant: "sheet"
Source
MatBottomSheet("Title") { Text("Content"); Button("Action") }MatButton¶
button matButton="text|filled|tonal|outlined|elevated" · .variant(.filled) or variant: "filled"
role button · arguments label · defaults variant: "text" · variants text, filled, tonal, outlined, elevated
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatButton("Label").variant("text"); Text("text").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatButton("Label").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatButton("Label").variant("tonal"); Text("tonal").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatButton("Label").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatButton("Label").variant("elevated"); Text("elevated").font(.caption).foregroundStyle(.secondary) }
}MatButtonToggle¶
mat-button-toggle
role button · arguments label · defaults variant: "toggle"
Source
MatButtonToggle("Label")MatButtonToggleGroup¶
mat-button-toggle-group: items: [..] or MatButtonToggle children, value:
role segmented · arguments items
Source
MatButtonToggleGroup(["One", "Two", "Three"])MatCalendar¶
mat-calendar: selection:, range: [a, b]
role calendar
Source
MatCalendar()MatCard¶
mat-card: title:, subtitle:, avatar:, image:, children = content, actions: slot; appearance raised|outlined|filled
role card · arguments title · defaults variant: "raised" · variants raised, outlined, filled
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatCard("Title") { Text("Content"); Button("Action") }.variant("raised"); Text("raised").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatCard("Title") { Text("Content"); Button("Action") }.variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatCard("Title") { Text("Content"); Button("Action") }.variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
}MatCardActions¶
mat-card-actions
role hstack · defaults spacing: 8
Source
MatCardActions() { Text("Content"); Button("Action") }MatCardContent¶
mat-card-content
role vstack · defaults alignment: "leading"
Source
MatCardContent() { Text("Content"); Button("Action") }MatCardHeader¶
mat-card-header
role hstack · defaults spacing: 16
Source
MatCardHeader() { Text("Content"); Button("Action") }MatCardImage¶
img mat-card-image
role image · arguments name
Source
MatCardImage().frame(width: 160, height: 96)MatCardSubtitle¶
mat-card-subtitle
role text · arguments content · defaults font: "titleSmall"
Source
MatCardSubtitle("Content")MatCardTitle¶
mat-card-title
role text · arguments content · defaults font: "titleLarge"
Source
MatCardTitle("Content")MatCheckbox¶
mat-checkbox: checked:, .state(.indeterminate)
role checkbox · arguments label
Source
MatCheckbox("Label")MatChip¶
mat-chip (assist/suggestion): systemImage:
role chip · arguments label · defaults variant: "assist"
Source
MatChip("Label")MatChipGrid¶
mat-chip-grid: MatChipRow children (input chips)
role hstack · defaults spacing: 8, wrap: True
Source
MatChipGrid() { Text("Content"); Button("Action") }MatChipListbox¶
mat-chip-listbox: MatChipOption children
role hstack · defaults spacing: 8, wrap: True
Source
MatChipListbox() { Text("Content"); Button("Action") }MatChipOption¶
mat-chip-option (filter): selected:
role chip · arguments label · defaults variant: "filter"
Source
MatChipOption("Label")MatChipRow¶
mat-chip-row (input chip with remove icon): avatar:
role chip · arguments label · defaults removable: True, variant: "input"
Source
MatChipRow("Label")MatChipSet¶
mat-chip-set: MatChip children
role hstack · defaults spacing: 8, wrap: True
Source
MatChipSet() { Text("Content"); Button("Action") }MatColumnDef¶
ng-container matColumnDef
role tablecolumn · arguments title
Source
MatColumnDef("Title")MatDateRangeInput¶
mat-date-range-input: selection: "11/3/2026 – 11/9/2026"
role datepicker · arguments label · defaults variant: "fill"
Source
MatDateRangeInput("Label")MatDateRangePicker¶
mat-date-range-picker panel: range: [a, b]
role calendar
Source
MatDateRangePicker()MatDatepicker¶
input [matDatepicker] + toggle: selection: "2026-11-23"
role datepicker · arguments label · defaults variant: "fill"
Source
MatDatepicker("Label")MatDialog¶
MatDialog content: title (mat-dialog-title), message:, children (mat-dialog-content), actions: slot (mat-dialog-actions)
role dialog · arguments title
Source
MatDialog("Title") { Text("Content"); Button("Action") }MatDialogActions¶
mat-dialog-actions
role hstack · defaults spacing: 8
Source
MatDialogActions() { Text("Content"); Button("Action") }MatDialogContent¶
mat-dialog-content
role vstack · defaults alignment: "leading"
Source
MatDialogContent() { Text("Content"); Button("Action") }MatDrawer¶
mat-drawer
role sidebar · arguments title · defaults variant: "side"
Source
MatDrawer("Title") { Text("Content"); Button("Action") }MatDrawerContainer¶
mat-drawer-container
role split
Source
MatDrawerContainer() { Text("Content"); Button("Action") }MatDrawerContent¶
mat-drawer-content
role vstack · defaults alignment: "stretch"
Source
MatDrawerContent() { Text("Content"); Button("Action") }MatExpansionPanel¶
mat-expansion-panel: title, description:, expanded:, children = body
role accordion · arguments title
Source
MatExpansionPanel("Title") { Text("Content"); Button("Action") }MatExtendedFab¶
button matFab extended: MatExtendedFab("Compose", icon: "edit")
role fab · arguments label
Source
MatExtendedFab("Label")MatFab¶
button matFab (floats bottom-trailing; inline: true to place in flow)
role fab · arguments icon
Source
MatFab("star")MatFlatButton¶
mat-flat-button (= matButton="filled")
role button · arguments label · defaults variant: "filled"
Source
MatFlatButton("Label")MatFormField¶
mat-form-field + matInput: label (mat-label), text:, placeholder:, helper: (mat-hint), error: (mat-error); .appearance(.outline)
role textfield · arguments label · defaults variant: "fill" · variants fill, outline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatFormField("Label").variant("fill"); Text("fill").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatFormField("Label").variant("outline"); Text("outline").font(.caption).foregroundStyle(.secondary) }
}MatGridList¶
mat-grid-list: MatGridList(4) { MatGridTile … } (cols as first argument)
role grid · arguments columns · defaults spacing: 4
Source
MatGridList(["Name", "Status"]) { Text("Content"); Button("Action") }MatGridTile¶
mat-grid-tile: a tile; children overlay it
role placeholder · arguments label
Source
MatGridTile("Label").frame(width: 160, height: 96)MatHorizontalStepper¶
mat-stepper orientation=horizontal
role tabs · defaults placement: "top", variant: "stepper"
Source
MatHorizontalStepper() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }MatIcon¶
mat-icon: Material Icons/Symbols name, e.g. MatIcon("home")
role icon · arguments name
Source
MatIcon("star")MatIconButton¶
button matIconButton: MatIconButton("more_vert")
role button · arguments icon · defaults iconOnly: True, variant: "icon"
Source
MatIconButton("star")MatInput¶
input matInput inside its mat-form-field (same as MatFormField)
role textfield · arguments label · defaults variant: "fill" · variants fill, outline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatInput("Label").variant("fill"); Text("fill").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatInput("Label").variant("outline"); Text("outline").font(.caption).foregroundStyle(.secondary) }
}MatList¶
mat-list: MatListItem children; .variant(.dense)
role list
Source
MatList() { Text("First item"); Text("Second item") }MatListItem¶
mat-list-item: title, subtitle: (matListItemLine), systemImage: (matListItemIcon), avatar:, detail: (matListItemMeta)
role listitem · arguments title
Source
MatListItem("Title")MatListOption¶
mat-list-option: checked:, subtitle:; checkbox after the text
role listitem · arguments title · defaults checkbox: True
Source
MatListOption("Title")MatListSubheader¶
matSubheader: section heading inside a list
role text · arguments content
Source
MatListSubheader("Content")MatMenu¶
mat-menu + [matMenuTriggerFor]: label or systemImage: (icon trigger), open: true, MatMenuItem children
role menu · arguments label
Source
MatMenu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MatMenuItem¶
button mat-menu-item: systemImage:, disabled
role menuitem · arguments label
Source
MatMenuItem("Label")MatMiniFab¶
button matMiniFab
role fab · arguments icon · defaults size: "small"
Source
MatMiniFab("star")MatNavList¶
mat-nav-list: MatListItem rows, the selected one .selected() (activated)
role list · defaults variant: "nav"
Source
MatNavList() { Text("First item"); Text("Second item") }MatNestedTreeNode¶
mat-nested-tree-node
role navitem · arguments label
Source
MatNestedTreeNode("Label")MatPaginator¶
mat-paginator: MatPaginator("1 – 10 of 100")
role pagination · arguments summary
Source
MatPaginator("Summary")MatProgressBar¶
mat-progress-bar: value: 0…100; no value = indeterminate
role progress
Source
MatProgressBar()MatProgressSpinner¶
mat-progress-spinner / mat-spinner: value:
role progress · defaults variant: "circular"
Source
MatProgressSpinner()MatRadioButton¶
mat-radio-button: checked:
role radio · arguments label
Source
MatRadioButton("Label")MatRadioGroup¶
mat-radio-group: options: [..] or MatRadioButton children, value:
role radiogroup · arguments label
Source
MatRadioGroup("Label")MatRaisedButton¶
mat-raised-button (= matButton="elevated")
role button · arguments label · defaults variant: "elevated"
Source
MatRaisedButton("Label")MatSelect¶
mat-select in a mat-form-field: options: [..] or MatOption children, value:, open: true
role select · arguments label · defaults variant: "fill" · variants fill, outline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatSelect("Label").variant("fill"); Text("fill").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatSelect("Label").variant("outline"); Text("outline").font(.caption).foregroundStyle(.secondary) }
}MatSelectionList¶
mat-selection-list: MatListOption children
role list · defaults variant: "selection"
Source
MatSelectionList() { Text("First item"); Text("Second item") }MatSidenav¶
mat-sidenav: title:, header:/footer: slots, children (usually a MatNavList)
role sidebar · arguments title · defaults variant: "side" · variants side, over, push
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { MatSidenav("Title") { Text("Content"); Button("Action") }.variant("side"); Text("side").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatSidenav("Title") { Text("Content"); Button("Action") }.variant("over"); Text("over").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { MatSidenav("Title") { Text("Content"); Button("Action") }.variant("push"); Text("push").font(.caption).foregroundStyle(.secondary) }
}MatSidenavContainer¶
mat-sidenav-container: MatSidenav { … } then MatSidenavContent { … }
role split
Source
MatSidenavContainer() { Text("Content"); Button("Action") }MatSidenavContent¶
mat-sidenav-content: the main area beside the sidenav
role vstack · defaults alignment: "stretch"
Source
MatSidenavContent() { Text("Content"); Button("Action") }MatSlideToggle¶
mat-slide-toggle: isOn: / checked:
role toggle · arguments label
Source
MatSlideToggle("Label")MatSlider¶
mat-slider: value:, min:, max:, ticks: (showTickMarks), value: [a, b] for a range
role slider
Source
MatSlider()MatSnackBar¶
MatSnackBar: message, action: "Undo"
role toast · arguments message
Source
MatSnackBar("Message")MatSortHeader¶
th mat-sort-header (sorted column: MatTable sortColumn:)
role tablecolumn · arguments title
Source
MatSortHeader("Title")MatSpinner¶
mat-spinner (indeterminate)
role progress · defaults variant: "circular"
Source
MatSpinner()MatStepper¶
mat-stepper: MatStep children, selection: index; orientation: .vertical
role tabs · defaults placement: "top", variant: "stepper"
Source
MatStepper() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }MatStepperHeader¶
Step header only: steps: [..], current:
role steps · arguments steps
Source
MatStepperHeader(["Cart", "Shipping", "Payment"])MatStrokedButton¶
mat-stroked-button (= matButton="outlined")
role button · arguments label · defaults variant: "outlined"
Source
MatStrokedButton("Label")MatTab¶
mat-tab: label, systemImage:, children = content
role tab · arguments label
Source
MatTab("Label")MatTabGroup¶
mat-tab-group: MatTab children, selectedIndex via selection:
role tabs · defaults placement: "top"
Source
MatTabGroup() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }MatTabNavBar¶
nav mat-tab-nav-bar: items: [..] or MatTabLink children
role tabs · arguments items · defaults placement: "top"
Source
MatTabNavBar(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }MatTable¶
mat-table: columns:, rows:, selectable: (SelectionModel), sortColumn: (matSort), toolbar:/footer: slots
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
MatTable(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])MatTextarea¶
textarea matInput (cdkTextareaAutosize): rows:
role textfield · arguments label · defaults kind: "multiline", variant: "fill"
Source
MatTextarea("Label")MatTimepicker¶
input [matTimepicker]: selection: "9:30 AM"
role datepicker · arguments label · defaults kind: "time", variant: "fill"
Source
MatTimepicker("Label")MatTonalButton¶
matButton="tonal"
role button · arguments label · defaults variant: "tonal"
Source
MatTonalButton("Label")MatToolbar¶
mat-toolbar: title, navigationIcon:, menu: true, children = actions; .color(.primary)
role appbar · arguments title
Source
MatToolbar("Title") { Text("Content"); Button("Action") }MatToolbarRow¶
mat-toolbar-row: a row of a multi-row toolbar
role toolbar
Source
MatToolbarRow() { Button("Save"); Button("Share") }MatTooltip¶
[matTooltip]: MatTooltip("Delete") { MatIconButton("delete") }
role tooltip · arguments text · defaults placement: "bottom"
Source
MatTooltip("Text") { Text("Content"); Button("Action") }MatTree¶
mat-tree: nested MatTreeNode children
role vstack · defaults alignment: "stretch", spacing: 0
Source
MatTree() { Text("Content"); Button("Action") }MatTreeNode¶
mat-tree-node: label, systemImage:, nested nodes as children, expanded:
role navitem · arguments label
Source
MatTreeNode("Label")MatVerticalStepper¶
mat-stepper orientation=vertical
role tabs · defaults orientation: "vertical", placement: "top", variant: "stepper"
Source
MatVerticalStepper() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }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")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")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") }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)Menu¶
role menu · arguments label
Source
Menu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }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") }