Skip to content

Avalonia UI

Imitates: Avalonia UI 11 · FluentTheme (cross-platform .NET desktop apps) Avalonia 11.3 · Pack id: avalonia · Selected by: pack="avalonia", import Avalonia, import AvaloniaUI, import Avalonia.Controls, import Avalonia.Themes.Fluent · Default device: desktop (windows chrome)

96 own elements, plus 118 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

AccessText

role text · arguments content

Content
Source
AccessText("Content")

AutoCompleteBox

AutoCompleteBox(text: "Lis", items: ["Lisbon", "Lismore"], isDropDownOpen: true, watermark:)

role select · arguments label · defaults variant: "autocomplete"

Source
AutoCompleteBox("Label")

Border

A decorator: style with .padding / .background / .cornerRadius / .border

role vstack · defaults alignment: "stretch"

ContentAction
Source
Border() { Text("Content"); Button("Action") }

Button

Button("Save", icon:) · classes: "accent" (Classes="accent") for the accent button

role button · arguments label · defaults variant: "default" · variants default, accent, transparent

Labeldefault
Labelaccent
Labeltransparent
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("accent"); Text("accent").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("transparent"); Text("transparent").font(.caption).foregroundStyle(.secondary) }
}

ButtonSpinner

role textfield · arguments text · defaults kind: "number", trailingIcon: "chevron.up.down"

Text
Source
ButtonSpinner("Text")

Calendar

Calendar(selectedDate: "2026-11-18") — today (Nov 23) has the accent fill, the selection an accent ring

role calendar · defaults showToday: True

November 2026
SuMoTuWeThFrSa12345678910111213141516171819202122232425262728293012345
Source
Calendar()

CalendarDatePicker

CalendarDatePicker(selectedDate: "2026-11-23", watermark:) — a TextBox with a calendar button

role datepicker · arguments label · defaults format: "numeric"

Source
CalendarDatePicker("Label")

Canvas

Absolute positioning: place children with .position(x:y:) (Canvas.Left/Top)

role canvas

ContentAction
Source
Canvas() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)

Carousel { current item } — one item at a time

role zstack

ContentAction
Source
Carousel() { Text("Content"); Button("Action") }

CartesianChart

LiveCharts2 CartesianChart(kind: .line|.bar|.area, series:, labels:)

role chart · defaults kind: "line"

Source
CartesianChart(values: [3, 5, 2, 6, 4])

CheckBox

CheckBox("Remember me", isChecked: true | .indeterminate) — IsThreeState shows the dash

role checkbox · arguments label

Label
Source
CheckBox("Label")

ColorPicker

ColorPicker(colors: ["#0078d7"], selection: 0) — the drop-down button with its colour preview

role swatches · arguments label · defaults variant: "picker"

Label
Source
ColorPicker("Label")

ColorSlider

role slider · arguments label

Label
Source
ColorSlider("Label")

ColorSpectrum

role placeholder · arguments label · defaults systemImage: "sun"

Label
Source
ColorSpectrum("Label").frame(width: 160, height: 96)

ColorView

ColorView palette: colors: [..], selection:

role swatches · arguments label

Label
Source
ColorView("Label")

ComboBox

ComboBox(items: ["S", "M"], selectedItem: "M", placeholderText:, isDropDownOpen: true) or ComboBoxItem children

role select · arguments label

Source
ComboBox("Label")

ComboBoxItem

role text · arguments content

Content
Source
ComboBoxItem("Content")

ContentControl

Hosts one piece of content

role group

ContentAction
Source
ContentControl() { Text("Content"); Button("Action") }

ContentPresenter

role group

ContentAction
Source
ContentPresenter() { Text("Content"); Button("Action") }

ContextMenu

ContextMenu { MenuItem… } — an open popup (place it with .padding / .position)

role menu

Source
ContextMenu() { Button("Open"); Button("Save"); Divider(); Button("Close") }

DataGrid

Avalonia.Controls.DataGrid(columns: [...], rows: [[...]], selected: [1]) or DataGrid*Column children

role table · defaults variant: "dataGrid"

NameStatus
Ana LimaActive
Ben OkaforAway
Source
DataGrid(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])

DataGridCheckBoxColumn

role tablecolumn · arguments title

Source
DataGridCheckBoxColumn("Title")

DataGridTemplateColumn

role tablecolumn · arguments title

Source
DataGridTemplateColumn("Title")

DataGridTextColumn

role tablecolumn · arguments title

Source
DataGridTextColumn("Title")

DatePicker

DatePicker(selectedDate: "2026-11-23") — month · day · year segments

role datepicker · arguments label · defaults format: "long", variant: "fields"

Source
DatePicker("Label")

Decorator

role group

ContentAction
Source
Decorator() { Text("Content"); Button("Action") }

Dialog

A modal child Window (ShowDialog): Dialog("Title") { content } actions: { Button… }

role dialog · arguments title · defaults closable: True

Source
Dialog("Title") { Text("Content"); Button("Action") }

DockPanel

DockPanel { top docks… ; fill } — docked children in order; put a left/right dock and the fill in an HStack

role vstack · defaults alignment: "stretch", spacing: 0

ContentAction
Source
DockPanel() { Text("Content"); Button("Action") }

Button with a chevron that opens a Flyout

role button · arguments label · defaults dropdown: True, variant: "default"

Label
Source
DropDownButton("Label")

Ellipse

role shape · defaults shape: "ellipse"

Source
Ellipse().frame(width: 160, height: 96)

Expander

Expander("Header", isExpanded: true) { content }

role accordion · arguments header

Header
Source
Expander("Header") { Text("Content"); Button("Action") }

Flyout

A light-dismiss popup surface; place with .overlay(alignment:) or .position

role card · arguments title · defaults variant: "flyout"

Title
ContentAction
Source
Flyout("Title") { Text("Content"); Button("Action") }

Grid

Grid(columns: 3, spacing: 12) { … } — column count (ColumnDefinitions as a count), or GridRow children

role grid

ContentAction
Source
Grid() { Text("Content"); Button("Action") }

GridSplitter

A draggable divider between grid cells

role divider

Source
GridSplitter()

HeaderedContentControl

HeaderedContentControl("Header") { content }

role section · arguments header

Header
First itemSecond item
Source
HeaderedContentControl("Header") { Text("First item"); Text("Second item") }

HyperlinkButton

HyperlinkButton("Learn more", navigateUri:) — link-styled button

role button · arguments label · defaults variant: "hyperlink"

Label
Source
HyperlinkButton("Label")

Image

Image("assets/images/photo-1.svg") or Image(source:)

role image · arguments name

Source
Image().frame(width: 160, height: 96)

ItemsControl

Repeats an item template: use ForEach inside

role vstack · defaults alignment: "stretch"

ContentAction
Source
ItemsControl() { Text("Content"); Button("Action") }

ItemsRepeater

Avalonia.Controls.ItemsRepeater: ForEach inside; .orientation(.horizontal) for a row

role vstack · defaults alignment: "stretch"

ContentAction
Source
ItemsRepeater() { Text("Content"); Button("Action") }

Label

Label("Name:") — a ContentControl caption for an input (Target:)

role text · arguments content

Content
Source
Label("Content")

LayoutTransformControl

role group

ContentAction
Source
LayoutTransformControl() { Text("Content"); Button("Action") }

ListBox

ListBox { ListBoxItem… } — selection uses the accent list brush; .selected() on an item

role list · defaults variant: "listBox"

First item
Second item
Source
ListBox() { Text("First item"); Text("Second item") }

ListBoxItem

ListBoxItem("Title", subtitle:, detail:, icon:) or a custom item template as children

role listitem · arguments title

Title
Source
ListBoxItem("Title")

MaskedTextBox

MaskedTextBox(mask: "(000) 000-0000") — the mask shows when empty

role textfield · arguments text

Text
Source
MaskedTextBox("Text")

Menu { MenuItem("File") … MenuBarItem("Edit", isSubMenuOpen: true) { MenuItem("Copy", inputGesture: "Ctrl+C") } }

role toolbar · defaults variant: "menubar"

Source
Menu() { Button("Save"); Button("Share") }

A top-level MenuItem of a Menu with its submenu (XAML writes MenuItem; this name lets it open: isSubMenuOpen: true)

role menu · arguments label · defaults caret: False, variant: "menubar"

Label
Source
MenuBarItem("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }

MenuFlyout { MenuItem… } — an open flyout; MenuFlyout("Sort", isOpen: true) { … } draws the DropDownButton that owns it

role menu · arguments label

Label
Source
MenuFlyout("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }

MenuItem("Copy", icon:, inputGesture: "Ctrl+C", isChecked:) — children make a submenu; in a Menu bar a closed top-level item

role menuitem · arguments label

Source
MenuItem("Label")

NotificationCard

NotificationCard("Saved", message:, type: .information|.success|.warning|.error) — put inside WindowNotificationManager

role toast · arguments title · defaults inline: True, severity: "information"

Title
Source
NotificationCard("Title")

NumericUpDown

NumericUpDown(value: 3, minimum:, maximum:, formatString:) — spinner on the right

role textfield · arguments value · defaults kind: "number", trailingIcon: "chevron.up.down"

Value
Source
NumericUpDown("Value")

Panel

Children overlap (Panel stacks them on top of each other)

role zstack

ContentAction
Source
Panel() { Text("Content"); Button("Action") }

Path

role shape · defaults shape: "rectangle"

Source
Path().frame(width: 160, height: 96)

PathIcon

PathIcon("Settings") — a geometry icon (FluentIcons names work)

role icon · arguments name

Source
PathIcon("star")

PieChart

LiveCharts2 PieChart(values:, labels:)

role chart · defaults kind: "donut"

Source
PieChart(values: [3, 5, 2, 6, 4])

PolarChart

LiveCharts2 PolarChart(series:, labels:)

role chart · defaults kind: "radar"

Source
PolarChart(values: [3, 5, 2, 6, 4])

role card · arguments title · defaults variant: "flyout"

Title
ContentAction
Source
Popup("Title") { Text("Content"); Button("Action") }

ProgressBar

ProgressBar(value: 60) — 0…100 (Maximum:); no value = indeterminate; showProgressText: true

role progress · arguments label · defaults total: 100

Label
Source
ProgressBar("Label")

RadioButton

RadioButton("Small", isChecked: true, groupName:)

role radio · arguments label

Label
Source
RadioButton("Label")

Rectangle

role shape · defaults shape: "rectangle"

Source
Rectangle().frame(width: 160, height: 96)

RefreshContainer

Pull-to-refresh host; refreshing: true shows the visualizer

role vstack · defaults alignment: "stretch"

ContentAction
Source
RefreshContainer() { Text("Content"); Button("Action") }

RefreshVisualizer

The pull-to-refresh spinner

role progress · defaults kind: "circular"

Source
RefreshVisualizer()

RelativePanel

role zstack

ContentAction
Source
RelativePanel() { Text("Content"); Button("Action") }

RepeatButton

Fires repeatedly while pressed

role button · arguments label · defaults variant: "default"

Label
Source
RepeatButton("Label")

ReversibleStackPanel

role vstack · defaults alignment: "stretch"

ContentAction
Source
ReversibleStackPanel() { Text("Content"); Button("Action") }

Run

role text · arguments content

Content
Source
Run("Content")

ScrollViewer

Scrolling region (static; Fluent overlay scroll bars are hidden at rest)

role scroll · arguments axes

ContentAction
Source
ScrollViewer() { Text("Content"); Button("Action") }

SelectableTextBlock

Text the user can select and copy

role text · arguments content

Content
Source
SelectableTextBlock("Content")

Separator

A horizontal rule (menus, stack panels)

role divider

Source
Separator()

Slider

Slider(value: 40, minimum: 0, maximum: 100, ticks: 10)

role slider · arguments label

Label
Source
Slider("Label")

SplitButton

Primary part + chevron that opens a Flyout

role button · arguments label · defaults split: True, variant: "default"

Label
Source
SplitButton("Label")

SplitView

SplitView(displayMode: .inline) { pane } content: { … } — the pane sits on PaneBackground

role split · defaults variant: "inline" · variants inline, compactInline, overlay, compactOverlay

Content
Action
inline
Content
Action
compactInline
Content
Action
overlay
Content
Action
compactOverlay
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { SplitView() { Text("Content"); Button("Action") }.variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { SplitView() { Text("Content"); Button("Action") }.variant("compactInline"); Text("compactInline").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { SplitView() { Text("Content"); Button("Action") }.variant("overlay"); Text("overlay").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { SplitView() { Text("Content"); Button("Action") }.variant("compactOverlay"); Text("compactOverlay").font(.caption).foregroundStyle(.secondary) }
}

StackPanel

StackPanel(spacing: 8, orientation: .horizontal) { … } — vertical by default, children stretch across

role vstack · defaults alignment: "stretch"

ContentAction
Source
StackPanel() { Text("Content"); Button("Action") }

SymbolIcon

FluentIcons.Avalonia SymbolIcon(symbol: "Home")

role icon · arguments name

Source
SymbolIcon("star")

TabControl

TabControl(selectedIndex: 0) { TabItem("General") { … } } — 24 px SemiLight headers with the accent pipe

role tabs · defaults placement: "top", variant: "tabControl"

OneTwo
First tab
Source
TabControl() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

TabItem

role tab · arguments label

Source
TabItem("Label")

TabStrip

TabStrip(items: [..], selectedIndex:) — headers only

role tabs · arguments items · defaults placement: "top", variant: "tabStrip"

OneTwo
First tab
Source
TabStrip(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

TabStripItem

role tab · arguments label

Source
TabStripItem("Label")

TextBlock

TextBlock("Hi", classes: "h2") — Text; .font(.title2), FontWeight via .bold()

role text · arguments content

Content
Source
TextBlock("Content")

TextBox

TextBox("text", watermark: "Hint", label:) · .passwordChar("•") · .acceptsReturn() (rows:) · classes: "clearButton" / "revealPasswordButton"

role textfield · arguments text

Text
Source
TextBox("Text")

TextEditor

AvaloniaEdit TextEditor("…", language:, lineNumbers:, highlight: [3]) — ShowLineNumbers

role code · arguments code

1let total = items.count
Source
TextEditor("let total = items.count")

TimePicker

TimePicker(selectedTime: "7:30 AM")

role datepicker · arguments label · defaults kind: "time", variant: "fields"

Source
TimePicker("Label")

TitleBar

A client-area title bar (ExtendClientAreaToDecorationsHint): TitleBar("App", logo:) { trailing controls }

role appbar · arguments title

Source
TitleBar("Title") { Text("Content"); Button("Action") }

ToggleButton

ToggleButton("Bold", isChecked: true) — checked uses the accent fill

role button · arguments label · defaults variant: "default"

Label
Source
ToggleButton("Label")

ToggleSplitButton

SplitButton whose primary part toggles (isChecked:)

role button · arguments label · defaults split: True, variant: "default"

Label
Source
ToggleSplitButton("Label")

ToggleSwitch

ToggleSwitch("Wi-Fi", isChecked: true, onContent:, offContent:) — Content is the header above the switch

role toggle · arguments label · defaults offText: "Off", onText: "On"

LabelOff
Source
ToggleSwitch("Label")

ToolTip

ToolTip("Hint") { target } — ToolTip.Tip

role tooltip · arguments text

ContentActionText
Source
ToolTip("Text") { Text("Content"); Button("Action") }

TransitioningContentControl

Shows the current page (transitions are static)

role group

ContentAction
Source
TransitioningContentControl() { Text("Content"); Button("Action") }

TreeView

TreeView { TreeViewItem("src", isExpanded: true) { TreeViewItem("App.axaml") } }

role tree

Folder
File
Source
TreeView() { TreeItem("Folder") { TreeItem("File") } }

TreeViewItem

TreeViewItem("Header", icon:, isExpanded:, isSelected:) { children }

role treeitem · arguments label

Label
Source
TreeViewItem("Label")

UniformGrid

UniformGrid(columns: n) { … }

role grid

ContentAction
Source
UniformGrid() { Text("Content"); Button("Action") }

UserControl

A reusable view's root

role vstack · defaults alignment: "stretch", spacing: 0

ContentAction
Source
UserControl() { Text("Content"); Button("Action") }

Viewbox

Scales its child (static)

role zstack

ContentAction
Source
Viewbox() { Text("Content"); Button("Action") }

VirtualizingStackPanel

role vstack · defaults alignment: "stretch"

ContentAction
Source
VirtualizingStackPanel() { Text("Content"); Button("Action") }

Window

Window { … } — the top-level window's content (title and decorations come from the fence's title/chrome)

role vstack · defaults alignment: "stretch", spacing: 0

ContentAction
Source
Window() { Text("Content"); Button("Action") }

WindowNotificationManager

Hosts NotificationCards in a window corner (position: .topRight|.bottomRight|.topLeft|.bottomLeft)

role vstack · defaults alignment: "stretch", position: "topRight", spacing: 8

ContentAction
Source
WindowNotificationManager() { Text("Content"); Button("Action") }

WrapPanel

Children left to right, wrapping

role hstack · defaults wrap: True

ContentAction
Source
WrapPanel() { Text("Content"); Button("Action") }

Core vocabulary in this style

Accordion

role accordion · arguments title

Title
Source
Accordion("Title") { Text("Content"); Button("Action") }

Alert

role dialog · arguments title · defaults variant: "alert"

Source
Alert("Title") { Text("Content"); Button("Action") }

AppBar

role appbar · arguments title

Source
AppBar("Title") { Text("Content"); Button("Action") }

AreaChart

role chart · defaults kind: "area"

Source
AreaChart(values: [3, 5, 2, 6, 4])

AsyncImage

role image · arguments url

Source
AsyncImage().frame(width: 160, height: 96)

Avatar

role avatar · arguments name

AL
Source
Avatar("Ana Lima")

Badge

role badge · arguments text

Text
Source
Badge("Text")

role alert · arguments title

Source
Banner("Title")

BarChart

role chart · defaults kind: "bar"

Source
BarChart(values: [3, 5, 2, 6, 4])

Board

Kanban board of BoardColumn children

role board

To do1
Write copy
Add card
Source
Board() { BoardColumn("To do") { KanbanCard("Write copy") } }

BoardColumn

BoardColumn("To do", count:, color:) { KanbanCard(…) }

role boardcolumn · arguments title

Title2
Write copy
Review
Add card
Source
BoardColumn("Title") { KanbanCard("Write copy"); KanbanCard("Review") }

role breadcrumb · arguments items

Source
Breadcrumb(["One", "Two", "Three"])

BubbleChart

role chart · defaults kind: "bubble"

Source
BubbleChart(values: [3, 5, 2, 6, 4])

Callout

a numbered annotation; place with .position(x:y:)

role callout · arguments number, text

1Text
Source
Callout(1, "Text")

CandlestickChart

role chart · defaults kind: "candlestick"

Source
CandlestickChart(values: [3, 5, 2, 6, 4])

Capsule

role shape · defaults shape: "capsule"

Source
Capsule().frame(width: 160, height: 96)

Card

role card · arguments title

Title
ContentAction
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])

Checkbox

role checkbox · arguments label

Label
Source
Checkbox("Label")

Chip

role chip · arguments label

Label
Source
Chip("Label")

Circle

role shape · defaults shape: "circle"

Source
Circle().frame(width: 160, height: 96)

CodeBlock

role code · arguments code · defaults lineNumbers: False

let total = items.count
Source
CodeBlock("let total = items.count")

CodeEditor

CodeEditor("…", language: "swift", lineNumbers:, highlight: [3], tabs: [..])

role code · arguments code

1let total = items.count
Source
CodeEditor("let total = items.count")

Color

role color · arguments color

Source
Color(.blue).frame(width: 160, height: 96)

ColorSwatches

colors: [.red, "#0af", …], selection:

role swatches

Source
ColorSwatches()

ComboChart

role chart · defaults kind: "combo"

Source
ComboChart(values: [3, 5, 2, 6, 4])

Comment

author:, time:, avatar:

role message · arguments text · defaults variant: "comment"

Text
Source
Comment("Text")

ControlGroup

role toolbar · defaults variant: "group"

Source
ControlGroup() { Button("Save"); Button("Share") }

DisclosureGroup

role accordion · arguments title

Title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }

Divider

role divider

Source
Divider()

DonutChart

role chart · defaults kind: "donut"

Source
DonutChart(values: [3, 5, 2, 6, 4])

Dropzone

role dropzone · arguments label

Label
Source
Dropzone("Label")

EmptyState

title, systemImage:, description: { actions }

role emptystate · arguments title

Title
Source
EmptyState("Title")

FloatingActionButton

role fab · arguments icon

Source
FloatingActionButton("star")

Form

role form

Name
Notifications
Source
Form() { TextField("Name"); Toggle("Notifications", isOn: true) }

FunnelChart

role chart · defaults kind: "funnel"

Source
FunnelChart(values: [3, 5, 2, 6, 4])

Gantt

scale: ["W1",…], tasks: [("Design", 0, 2, 0.6), …], today:

role gantt

1234567
Design
Build
Source
Gantt(tasks: [("Design", 0, 3), ("Build", 2, 5)])

Gauge

role progress · arguments value · defaults variant: "gauge"

Source
Gauge(60)

GaugeChart

role chart · defaults kind: "gauge"

Source
GaugeChart(values: [3, 5, 2, 6, 4])

GridRow

role gridrow

ContentAction
Source
GridRow() { Text("Content"); Button("Action") }

Group

role group

ContentAction
Source
Group() { Text("Content"); Button("Action") }

GroupBox

role card · arguments title

Title
ContentAction
Source
GroupBox("Title") { Text("Content"); Button("Action") }

HStack

Horizontal stack. spacing:, alignment: .top|.center|.bottom

role hstack

ContentAction
Source
HStack() { Text("Content"); Button("Action") }

Heatmap

role chart · defaults kind: "heatmap"

Source
Heatmap(values: [3, 5, 2, 6, 4])

Histogram

role chart · defaults kind: "histogram"

Source
Histogram(values: [3, 5, 2, 6, 4])

Icon

role icon · arguments name

Source
Icon("star")

IconButton

role button · arguments icon · defaults iconOnly: True

Source
IconButton("star")

KanbanCard

title, description:, tags: [..], assignees: [..], due:, comments:, priority:

role kanbancard · arguments title

Title
Source
KanbanCard("Title")

Kbd

Kbd(["⌘", "K"]) or Kbd("Esc")

role kbd · arguments keys

⌘K
Source
Kbd(["⌘", "K"])

LabeledContent

role labeled · arguments label, value

LabelContentAction
Source
LabeledContent("Label", "Value") { Text("Content"); Button("Action") }

LazyHGrid

role grid

ContentAction
Source
LazyHGrid() { Text("Content"); Button("Action") }

LazyHStack

role hstack

ContentAction
Source
LazyHStack() { Text("Content"); Button("Action") }

LazyVGrid

columns: [GridItem(.flexible()), …] or a count

role grid

ContentAction
Source
LazyVGrid() { Text("Content"); Button("Action") }

LazyVStack

role vstack

ContentAction
Source
LazyVStack() { Text("Content"); Button("Action") }

LineChart

role chart · defaults kind: "line"

Source
LineChart(values: [3, 5, 2, 6, 4])

role link · arguments label, destination

Label
Source
Link("Label")

List

.listStyle(.insetGrouped|.plain|.sidebar|…)

role list

First item
Second item
Source
List() { Text("First item"); Text("Second item") }

ListItem

role listitem · arguments title

Title
Source
ListItem("Title")

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

Text
Source
MessageBubble("Text")

role navitem · arguments label

Label
Source
NavItem("Label")

role listitem · arguments title · defaults chevron: True

Title
Source
NavigationLink("Title")

{ sidebar } content: { … } detail: { … }

role split

Content
Action
Source
NavigationSplitView() { Text("Content"); Button("Action") }

Content's .navigationTitle / .toolbar form the bar

role navstack

ContentAction
Source
NavigationStack() { Text("Content"); Button("Action") }

role navstack

ContentAction
Source
NavigationView() { Text("Content"); Button("Action") }

Pagination

role pagination

Source
Pagination()

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

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

Label
Source
ProgressView("Label")

RadarChart

role chart · defaults kind: "radar"

Source
RadarChart(values: [3, 5, 2, 6, 4])

RadioGroup

role radiogroup · arguments label

Label
Source
RadioGroup("Label")

Rating

role rating · arguments value

Source
Rating(60)

RoundedRectangle

role shape · defaults shape: "rounded"

Source
RoundedRectangle().frame(width: 160, height: 96)

Row

title, subtitle:, detail:, systemImage:, chevron:

role listitem · arguments title

Title
Source
Row("Title")

ScatterChart

role chart · defaults kind: "scatter"

Source
ScatterChart(values: [3, 5, 2, 6, 4])

Schedule

days: [..], startHour:, endHour:, events: [("Standup", "Mon", 9, 9.5, .blue)], now:

role schedule

8:009:0010:0011:0012:0013:0014:0015:0016:0017:00
Mon
Tue
Wed
Thu
Fri
Source
Schedule()

ScrollView

role scroll · arguments axes

ContentAction
Source
ScrollView() { Text("Content"); Button("Action") }

SearchField

role textfield · arguments placeholder · defaults kind: "search"

Placeholder
Source
SearchField("Placeholder")

Section

Section("Header") { … } footer: { … }

role section · arguments title

Title
First itemSecond item
Source
Section("Title") { Text("First item"); Text("Second item") }

SecureField

role textfield · arguments placeholder · defaults kind: "password"

Placeholder
Source
SecureField("Placeholder")

SegmentedControl

role segmented · arguments items

OneTwoThree
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") }

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)

Spacer

role spacer

Source
Spacer()

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

AB
1AB
212
334
Source
Spreadsheet(columns: ["A", "B"], rows: [[1, 2], [3, 4]])

Stat

Stat("Revenue", "$48k", change: "+12%", trend: [..], systemImage:)

role stat · arguments label, value

Label
60
Source
Stat("Label", 60)

Stepper

role stepper · arguments label

Label
Source
Stepper("Label")

Steps

role steps · arguments steps

1Cart
2Shipping
3Payment
Source
Steps(["Cart", "Shipping", "Payment"])

StickyNote

StickyNote("Call Ana", color: .yellow, rotation: -2, author:)

role stickynote · arguments text

Text
Source
StickyNote("Text")

Tab

Tab("Home", systemImage: "house") { … }

role tab · arguments label

Source
Tab("Label")

TabView

Children with .tabItem { Label } or Tab(…)

role tabs · defaults placement: "bottom"

OneTwo
First tab
Source
TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

Table

columns: ["Name", …], rows: [[…], …] or TableRow children

role table

NameStatus
Ana LimaActive
Ben OkaforAway
Source
Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])

TableColumn

role tablecolumn · arguments title

Source
TableColumn("Title")

TableRow

role tablerow

Source
TableRow()

Tabs

role tabs · arguments items · defaults placement: "top"

OneTwo
First tab
Source
Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }

Tag

role chip · arguments label

Label
Source
Tag("Label")

Terminal

lines starting with "$ " are commands

role code · arguments code · defaults variant: "terminal"

Terminal
let total = items.count
Source
Terminal("let total = items.count")

Text

Text with bold, italic, code Markdown

role text · arguments content

Content
Source
Text("Content")

TextField

TextField("Placeholder", text: "value")

role textfield · arguments placeholder

Placeholder
Source
TextField("Placeholder")

Timeline

role timeline

Created
Shipped
Source
Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }

TimelineItem

title, time:, description:, systemImage:, status:

role timelineitem · arguments title

Title
Source
TimelineItem("Title")

Toast

role toast · arguments message

Message
Source
Toast("Message")

Toggle

Toggle("Wi-Fi", isOn: true)

role toggle · arguments label

Label
Source
Toggle("Label")

Toolbar

role toolbar

Source
Toolbar() { Button("Save"); Button("Share") }

ToolbarItem

ToolbarItem(placement: .topBarTrailing) { … }

role toolbaritem

ContentAction
Source
ToolbarItem() { Text("Content"); Button("Action") }

ToolbarItemGroup

role toolbaritem

ContentAction
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }

Tooltip

role tooltip · arguments text

ContentActionText
Source
Tooltip("Text") { Text("Content"); Button("Action") }

Tree

Tree { TreeItem("src") { TreeItem("main.swift") } }

role tree

Folder
File
Source
Tree() { TreeItem("Folder") { TreeItem("File") } }

TreeItem

label, systemImage:, folder:, expanded:, selected:, detail:

role treeitem · arguments label

Label
Source
TreeItem("Label")

Treemap

role chart · defaults kind: "treemap"

Source
Treemap(values: [3, 5, 2, 6, 4])

VStack

Vertical stack. spacing:, alignment: .leading|.center|.trailing

role vstack

ContentAction
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"

ContentAction
Source
Whiteboard() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)

ZStack

Overlapping layers. alignment:

role zstack

ContentAction
Source
ZStack() { Text("Content"); Button("Action") }