Fluent (WinUI 3)¶
Imitates: Fluent 2 · WinUI 3 (Windows 11 desktop apps) Windows App SDK 1.8 · Pack id: fluent · Selected by: pack="fluent", import WinUI, import FluentUI, import Fluent, import WindowsAppSDK, import Microsoft.UI.Xaml · Default device: desktop (windows chrome)
108 own elements, plus 125 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¶
AnimatedVisualPlayer¶
role placeholder · arguments label · defaults icon: "sparkles"
Source
AnimatedVisualPlayer("Label").frame(width: 160, height: 96)AppBarButton¶
AppBarButton("Share", icon: "Share") inside a CommandBar
role button · arguments label · defaults variant: "appBar"
Source
AppBarButton("Label")AppBarElementContainer¶
role group
Source
AppBarElementContainer() { Text("Content"); Button("Action") }AppBarToggleButton¶
selected: true = IsChecked
role button · arguments label · defaults variant: "appBar"
Source
AppBarToggleButton("Label")AutoSuggestBox¶
AutoSuggestBox("Search", text:) — query icon on the right
role textfield · arguments placeholder · defaults kind: "search"
Source
AutoSuggestBox("Placeholder")Border¶
A container; style it with .padding / .background / .cornerRadius / .border
role vstack · defaults alignment: "leading"
Source
Border() { Text("Content"); Button("Action") }BreadcrumbBar¶
BreadcrumbBar(["System", "Display"]) · .variant(.title) for a page title
role breadcrumb · arguments items · variants default, title
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { BreadcrumbBar(["One", "Two", "Three"]).variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { BreadcrumbBar(["One", "Two", "Three"]).variant("title"); Text("title").font(.caption).foregroundStyle(.secondary) }
}Button¶
Button("Save", icon:) · .buttonStyle(.accent | .subtle)
role button · arguments label · defaults variant: "standard" · variants standard, accent, subtle, hyperlink
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("standard"); Text("standard").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("accent"); Text("accent").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("subtle"); Text("subtle").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("hyperlink"); Text("hyperlink").font(.caption).foregroundStyle(.secondary) }
}CalendarDatePicker¶
CalendarDatePicker("Start", date:, placeholder: "Pick a date")
role datepicker · arguments header
Source
CalendarDatePicker("Header")CalendarView¶
CalendarView(selection: "2026-11-23", showToday: true)
role calendar
Source
CalendarView()CheckBox¶
CheckBox("Remember me", checked: true | .indeterminate)
role checkbox · arguments label
Source
CheckBox("Label")ColorPicker¶
role placeholder · arguments label · defaults icon: "palette"
Source
ColorPicker("Label").frame(width: 160, height: 96)ComboBox¶
ComboBox("Size", items: ["S", "M"], selection: "M", placeholder:, open: true)
role select · arguments header · variants editable
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ComboBox("Header").variant("editable"); Text("editable").font(.caption).foregroundStyle(.secondary) }
}CommandBar¶
CommandBar { AppBarButton… } · .defaultLabelPosition(.bottom | .right | .collapsed); AppBarButton(icon: "More") for the overflow button
role toolbar · defaults placement: "right" · variants right, bottom, collapsed
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { CommandBar() { Button("Save"); Button("Share") }.variant("right"); Text("right").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { CommandBar() { Button("Save"); Button("Share") }.variant("bottom"); Text("bottom").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { CommandBar() { Button("Save"); Button("Share") }.variant("collapsed"); Text("collapsed").font(.caption).foregroundStyle(.secondary) }
}CommandBarFlyout¶
role menu · arguments label
Source
CommandBarFlyout("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }ContentDialog¶
ContentDialog("Save?", buttons: ["Save", "Don't save", "Cancel"], primary: "Save") { content }
role dialog · arguments title
Source
ContentDialog("Title") { Text("Content"); Button("Action") }DataGrid¶
Community Toolkit DataGrid(columns: [...], rows: [[...]])
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
DataGrid(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])DatePicker¶
DatePicker("Birthday", date: "2026-11-23")
role datepicker · arguments header · defaults format: "long", variant: "fields"
Source
DatePicker("Header")DockPanel¶
role vstack · defaults alignment: "stretch"
Source
DockPanel() { Text("Content"); Button("Action") }DropDownButton¶
Button with a chevron that opens a flyout
role button · arguments label · defaults dropdown: True, variant: "standard"
Source
DropDownButton("Label")Expander¶
Expander("Header", isExpanded: true) { content }
role accordion · arguments header
Source
Expander("Header") { Text("Content"); Button("Action") }FlipView¶
role placeholder · arguments label · defaults icon: "photo"
Source
FlipView("Label").frame(width: 160, height: 96)Flyout¶
A light-dismiss surface; place it with .overlay(alignment:)
role card · arguments title · defaults variant: "flyout"
Source
Flyout("Title") { Text("Content"); Button("Action") }FontIcon¶
FontIcon("Mail") — Fluent / Segoe Fluent Icons name
role icon · arguments name
Source
FontIcon("star")Frame¶
Navigation host — renders its content
role group
Source
Frame() { Text("Content"); Button("Action") }Grid¶
Grid(columns: 3) { … } — column count, or GridRow children
role grid
Source
Grid() { Text("Content"); Button("Action") }GridView¶
GridView(columns: 4) { GridViewItem… }
role grid · defaults columns: 4
Source
GridView() { Text("Content"); Button("Action") }GridViewItem¶
role vstack · defaults alignment: "stretch"
Source
GridViewItem() { Text("Content"); Button("Action") }HeaderedContentControl¶
Header text above content
role section · arguments header
Source
HeaderedContentControl("Header") { Text("First item"); Text("Second item") }HyperlinkButton¶
Link-styled button
role button · arguments label · defaults variant: "hyperlink"
Source
HyperlinkButton("Label")InfoBadge¶
InfoBadge(5) or InfoBadge() dot; .variant(.critical)
role badge · arguments value · defaults variant: "attention" · variants attention, informational, success, caution, critical
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { InfoBadge("Value").variant("attention"); Text("attention").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { InfoBadge("Value").variant("informational"); Text("informational").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { InfoBadge("Value").variant("success"); Text("success").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { InfoBadge("Value").variant("caution"); Text("caution").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { InfoBadge("Value").variant("critical"); Text("critical").font(.caption).foregroundStyle(.secondary) }
}InfoBar¶
InfoBar("Title", message:, severity: .informational|.success|.warning|.error) { … } actions: { Button }
role alert · arguments title · defaults isClosable: True, severity: "informational"
Source
InfoBar("Title")ItemsRepeater¶
role vstack · defaults alignment: "stretch"
Source
ItemsRepeater() { Text("Content"); Button("Action") }ItemsView¶
role grid · defaults columns: 3
Source
ItemsView() { Text("Content"); Button("Action") }ListView¶
ListView { ListViewItem… } — selection with .selected()
role list
Source
ListView() { Text("First item"); Text("Second item") }ListViewItem¶
ListViewItem("Title", subtitle:, detail:, icon:, avatar:)
role listitem · arguments title
Source
ListViewItem("Title")MapControl¶
role placeholder · arguments label · defaults icon: "map"
Source
MapControl("Label").frame(width: 160, height: 96)MediaPlayerElement¶
role placeholder · arguments label · defaults icon: "play"
Source
MediaPlayerElement("Label").frame(width: 160, height: 96)MenuBar¶
MenuBar { MenuBarItem("File") { … } }
role toolbar · defaults variant: "menubar"
Source
MenuBar() { Button("Save"); Button("Share") }MenuBarItem¶
MenuBarItem("Edit", open: true) { MenuFlyoutItem… }
role menu · arguments label · defaults caret: False, variant: "menubar"
Source
MenuBarItem("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MenuFlyout¶
MenuFlyout { MenuFlyoutItem… } — open popup; with a label it is a button (open: true)
role menu · arguments label
Source
MenuFlyout("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MenuFlyoutItem¶
MenuFlyoutItem("Copy", icon: "Copy", shortcut: "Ctrl+C")
role menuitem · arguments label
Source
MenuFlyoutItem("Label")MenuFlyoutSubItem¶
Item with a submenu chevron (children)
role menuitem · arguments label
Source
MenuFlyoutSubItem("Label")NavigationView¶
NavigationView { pane items } content: { page } · .paneDisplayMode(.leftCompact | .top)
role split · defaults variant: "left" · variants left, leftCompact, leftMinimal, top, auto
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NavigationView() { Text("Content"); Button("Action") }.variant("left"); Text("left").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationView() { Text("Content"); Button("Action") }.variant("leftCompact"); Text("leftCompact").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationView() { Text("Content"); Button("Action") }.variant("leftMinimal"); Text("leftMinimal").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationView() { Text("Content"); Button("Action") }.variant("top"); Text("top").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NavigationView() { Text("Content"); Button("Action") }.variant("auto"); Text("auto").font(.caption).foregroundStyle(.secondary) }
}NavigationViewItem¶
NavigationViewItem("Home", icon: "Home", badge: 3) · .selected()
role navitem · arguments label
Source
NavigationViewItem("Label")NavigationViewItemHeader¶
role text · arguments content
Source
NavigationViewItemHeader("Content")NumberBox¶
NumberBox("Quantity", text: "3") · .spinButtonPlacementMode(.inline | .compact)
role textfield · arguments header · defaults kind: "number", trailingIcon: "chevron.up.down" · variants hidden, compact, inline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { NumberBox("Header").variant("hidden"); Text("hidden").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NumberBox("Header").variant("compact"); Text("compact").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { NumberBox("Header").variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
}PasswordBox¶
PasswordBox("Password", text: "secret")
role textfield · arguments header · defaults kind: "password", reveal: True
Source
PasswordBox("Header")PersonPicture¶
PersonPicture("Ana Diaz", image:, initials:, badge:, size: .small|.large)
role avatar · arguments name
Source
PersonPicture("Ana Lima")PipsPager¶
PipsPager(count: 5, page: 2)
role pagination · defaults variant: "pips"
Source
PipsPager()Pivot¶
Pivot { PivotItem("All") { … } }
role tabs · defaults placement: "top", variant: "pivot"
Source
Pivot() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }ProgressBar¶
ProgressBar(value: 0.6) — no value = indeterminate; .state(.paused | .error)
role progress · arguments label
Source
ProgressBar("Label")ProgressRing¶
ProgressRing() indeterminate, or value: 0.7
role progress · arguments label · defaults variant: "ring"
Source
ProgressRing("Label")RadioButton¶
RadioButton("Small", checked: true)
role radio · arguments label
Source
RadioButton("Label")RadioButtons¶
RadioButtons("Theme", items: ["Light", "Dark"], selection: "Dark")
role radiogroup · arguments label
Source
RadioButtons("Label")RadioMenuFlyoutItem¶
checked: true
role menuitem · arguments label · defaults checked: False
Source
RadioMenuFlyoutItem("Label")RangeSelector¶
Community Toolkit: value: [20, 80]
role slider · arguments label
Source
RangeSelector("Label")RatingControl¶
RatingControl(3.5, max: 5, label:)
role rating · arguments value
Source
RatingControl(60)RepeatButton¶
role button · arguments label · defaults variant: "standard"
Source
RepeatButton("Label")RichEditBox¶
Multi-line rich text editor (rows:)
role textfield · arguments header · defaults kind: "multiline"
Source
RichEditBox("Header")ScrollView¶
WinUI 1.5 ScrollView (static)
role scroll · arguments axes
Source
ScrollView() { Text("Content"); Button("Action") }ScrollViewer¶
Scrolling region (static)
role scroll · arguments axes
Source
ScrollViewer() { Text("Content"); Button("Action") }Segmented¶
Community Toolkit Segmented(items:, selection:)
role segmented · arguments items
Source
Segmented(["One", "Two", "Three"])SelectorBar¶
SelectorBar { SelectorBarItem("Recent") … }
role tabs · defaults placement: "top", variant: "selector"
Source
SelectorBar() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }SettingsCard¶
SettingsCard("Header", description:, icon:, chevron:) { control } — Community Toolkit
role listitem · arguments title
Source
SettingsCard("Title")SettingsExpander¶
SettingsExpander("Header", description:, icon:, expanded:) { SettingsCard… } trailing: { control }
role accordion · arguments header
Source
SettingsExpander("Header") { Text("Content"); Button("Action") }Slider¶
Slider("Volume", value: 40, in: 0...100, ticks: 10)
role slider · arguments label
Source
Slider("Label")SplitButton¶
Primary part + chevron part
role button · arguments label · defaults split: True, variant: "standard"
Source
SplitButton("Label")SplitView¶
SplitView { pane } content: { … }
role split
Source
SplitView() { Text("Content"); Button("Action") }StackPanel¶
StackPanel(spacing: 8, orientation: .horizontal) { … } — children stretch across, controls keep their width (alignment: .leading to opt out)
role vstack · defaults alignment: "stretch"
Source
StackPanel() { Text("Content"); Button("Action") }SymbolIcon¶
SymbolIcon("Accept") — Symbol enum name
role icon · arguments name
Source
SymbolIcon("star")TabView¶
TabView(selection:) { TabViewItem("Doc.txt", icon:) { … } } — tabs with close buttons and “+”
role tabs · defaults placement: "top", variant: "document"
Source
TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }TeachingTip¶
TeachingTip("Title", subtitle:, placement: .bottom|.top|.bottomLeft|.bottomRight|.topLeft|.topRight) { target } actions: { Button }
role tooltip · arguments title · defaults placement: "bottom"
Source
TeachingTip("Title") { Text("Content"); Button("Action") }TextBlock¶
TextBlock("Hi", style: .titleTextBlockStyle) — Caption, Body, BodyStrong, BodyLarge, Subtitle, Title, TitleLarge, Display
role text · arguments content
Source
TextBlock("Content")TextBox¶
TextBox("Name", text:, placeholder:, description:) · .state(.focused)
role textfield · arguments header
Source
TextBox("Header")TimePicker¶
TimePicker("Alarm", value: "7:30 AM")
role datepicker · arguments header · defaults kind: "time", variant: "fields"
Source
TimePicker("Header")TitleBar¶
TitleBar("App", subtitle:, logo: "icon", back: true, menu: true) content: { AutoSuggestBox } { right header }
role appbar · arguments title
Source
TitleBar("Title") { Text("Content"); Button("Action") }ToggleButton¶
ToggleButton("Bold", selected: true) — selected is IsChecked
role button · arguments label · defaults variant: "standard"
Source
ToggleButton("Label")ToggleMenuFlyoutItem¶
checked: true
role menuitem · arguments label · defaults checked: False
Source
ToggleMenuFlyoutItem("Label")ToggleSplitButton¶
SplitButton whose primary part toggles (selected:)
role button · arguments label · defaults split: True, variant: "standard"
Source
ToggleSplitButton("Label")ToggleSwitch¶
ToggleSwitch("Wi-Fi", isOn: true, onText:, offText:) — label is the Header
role toggle · arguments label · defaults offText: "Off", onText: "On"
Source
ToggleSwitch("Label")ToolTip¶
ToolTip("Hint") { target }
role tooltip · arguments text
Source
ToolTip("Text") { Text("Content"); Button("Action") }TreeView¶
TreeView { TreeViewItem("Docs", icon:, expanded: true) { … } }
role list · defaults variant: "tree"
Source
TreeView() { Text("First item"); Text("Second item") }TwoPaneView¶
TwoPaneView { pane1 } content: { pane2 }
role split
Source
TwoPaneView() { Text("Content"); Button("Action") }UniformGrid¶
Community Toolkit UniformGrid(columns: n)
role grid
Source
UniformGrid() { Text("Content"); Button("Action") }WebView2¶
role placeholder · arguments label · defaults icon: "globe"
Source
WebView2("Label").frame(width: 160, height: 96)WrapPanel¶
Community Toolkit WrapPanel
role hstack · defaults wrap: True
Source
WrapPanel() { 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") }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])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") }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)])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()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")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") }