Skip to content

GTK 4 · libadwaita

Imitates: GTK 4 with libadwaita and the Adwaita stylesheet (GNOME 48/49) GTK 4.18 · libadwaita 1.7/1.8 · Pack id: gtk · Selected by: pack="gtk", import Gtk, import Adwaita, import Libadwaita, import GNOME · Default device: desktop (gnome chrome)

107 own elements, plus 122 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

AboutDialog

AboutDialog(applicationName:, developerName:, applicationIcon:) { rows }

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

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

ActionBar

ActionBar { start … Spacer() … end } — bottom bar

role toolbar · defaults variant: "actionbar"

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

ActionRow

ActionRow("Title", subtitle:, icon:, chevron: true) { suffix widgets }

role listitem · arguments title

Title
Source
ActionRow("Title")

AlertDialog

AlertDialog("Delete Notes?", body:, responses: ["Cancel", "Delete"], defaultResponse: "Delete", destructive: "Delete")

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

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

ApplicationWindow

Adw.ApplicationWindow — the window content; put a ToolbarView or a split view inside

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

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

Avatar

Avatar("Ana Lima", size: .large, image:) — Adwaita gradient colours

role avatar · arguments name

AL
Source
Avatar("Ana Lima")

Banner("Title", actions: { Button("Restart") }) — the strip under a HeaderBar

role alert · arguments title · defaults showIcon: False

Source
Banner("Title")

Bin

A single-child container

role group

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

BottomSheet

Adw.BottomSheet (1.6)

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

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

Box

Box(orientation: .horizontal, spacing: 6) { … } · .variant(.linked) joins buttons

role vstack · defaults alignment: "stretch" · variants linked, toolbar

ContentAction
linked
ContentAction
toolbar
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Box() { Text("Content"); Button("Action") }.variant("linked"); Text("linked").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Box() { Text("Content"); Button("Action") }.variant("toolbar"); Text("toolbar").font(.caption).foregroundStyle(.secondary) }
}

BoxedList

ListBox styled .boxed-list — rows in a rounded card

role list · defaults variant: "boxedList"

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

BreakpointBin

role group

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

Button

Button("Save", icon:) · .variant(.suggested | .destructive | .flat | .pill | .circular | .osd)

role button · arguments label · variants suggested, destructive, flat, raised, pill, circular, osd, opaque, linked

Labelsuggested
Labeldestructive
Labelflat
Labelraised
Labelpill
Labelcircular
Labelosd
Labelopaque
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("suggested"); Text("suggested").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("destructive"); Text("destructive").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("raised"); Text("raised").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("pill"); Text("pill").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("circular"); Text("circular").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("osd"); Text("osd").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("opaque"); Text("opaque").font(.caption).foregroundStyle(.secondary) }
}

ButtonRow

ButtonRow("Add Account", icon:) · .variant(.suggested | .destructive) — 1.6

role listitem · arguments title · variants suggested, destructive

Title
suggested
Title
destructive
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ButtonRow("Title").variant("suggested"); Text("suggested").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ButtonRow("Title").variant("destructive"); Text("destructive").font(.caption).foregroundStyle(.secondary) }
}

Calendar

Calendar(selection: "2026-11-24", marked: […])

role calendar

November 2026
SuMoTuWeThFrSa12345678910111213141516171819202122232425262728293012345
Source
Calendar()

Carousel { pages } — horizontal pages

role scroll · defaults axes: "horizontal"

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

CarouselIndicatorDots

CarouselIndicatorDots(pages: 4, position: 2)

role pagination · defaults variant: "dots"

Source
CarouselIndicatorDots()

CarouselIndicatorLines

role pagination · defaults variant: "lines"

Source
CarouselIndicatorLines()

CenterBox

start / center / end widgets in a row

role hstack

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

CheckButton

CheckButton("Label", active: true)

role checkbox · arguments label · variants selectionMode

LabelselectionMode
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { CheckButton("Label").variant("selectionMode"); Text("selectionMode").font(.caption).foregroundStyle(.secondary) }
}

Clamp

Clamp { … } — limits its child to 600 px (maximumSize:) and centres it

role vstack · defaults alignment: "stretch"

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

ClampScrollable

role vstack · defaults alignment: "stretch"

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

ColorDialogButton

colors: [..], selection:

role swatches

Source
ColorDialogButton()

ColumnView

ColumnView(columns: ["Name", "Size"], rows: [[…]]) — Gtk.ColumnView data table

role table

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

ColumnViewColumn

role tablecolumn · arguments title

Source
ColumnViewColumn("Title")

ComboRow

ComboRow("Title", subtitle:, selected: "Current value")

role listitem · arguments title · defaults chevron: True

Title
Source
ComboRow("Title")

Dialog

Adw.Dialog("Title") { ToolbarView … }

role dialog · arguments title

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

DropDown(model: ["A", "B"], selected: "A", open:)

role select · arguments label

Source
DropDown("Label")

EditableLabel

role textfield · arguments text

Text
Source
EditableLabel("Text")

Entry

Entry("Placeholder", text:, icon:) · .state(.focused | .error)

role textfield · arguments placeholder

Placeholder
Source
Entry("Placeholder")

EntryRow

EntryRow("Title", text:) — the title floats above the text

role textfield · arguments title

Source
EntryRow("Title")

ExpanderRow

ExpanderRow("Title", subtitle:, expanded: true) { nested rows }

role accordion · arguments title

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

FlowBox

FlowBox(columns: 5) { FlowBoxChild … }

role grid · defaults columns: 4

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

FlowBoxChild

role vstack

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

FontDialogButton

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

Label
Source
FontDialogButton("Label")

Frame

Gtk.Frame — a bordered box

role card · arguments title

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

GridView

GridView(columns: 6) { … } — Nautilus-style icon grid

role grid · defaults columns: 5

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

HeaderBar

HeaderBar("Title", subtitle:, start: { … }, titleWidget: { ViewSwitcher }) { end widgets } — draws the window close button; showEndTitleButtons: false for inner panes

role appbar · arguments title · defaults kind: "window" · variants flat, raised

flat
raised
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { HeaderBar("Title") { Text("Content"); Button("Action") }.variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { HeaderBar("Title") { Text("Content"); Button("Action") }.variant("raised"); Text("raised").font(.caption).foregroundStyle(.secondary) }
}

InlineViewSwitcher

Adw.InlineViewSwitcher (1.7) — items:, selection:

role segmented · arguments items

OneTwoThree
Source
InlineViewSwitcher(["One", "Two", "Three"])

Label

Label("Text", style: .title1 | .title2 | .title3 | .title4 | .heading | .caption | .captionHeading | .largeTitle) · .class("dim-label")

role text · arguments content

Content
Source
Label("Content")

LevelBar

LevelBar(value: 0.7) · .color(.warning | .error | .success) for the low/high offsets

role progress · arguments label · defaults variant: "levelbar"

Label
Source
LevelBar("Label")

LinkButton

LinkButton("Website", uri:)

role link · arguments label, destination

Label
Source
LinkButton("Label")

ListBox

ListBox { rows } · .variant(.boxedList | .navigationSidebar | .richList)

role list · variants boxedList, boxedListSeparate, navigationSidebar, richList, plain

First item
Second item
boxedList
First item
Second item
boxedListSeparate
First item
Second item
navigationSidebar
First item
Second item
richList
First item
Second item
plain
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ListBox() { Text("First item"); Text("Second item") }.variant("boxedList"); Text("boxedList").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListBox() { Text("First item"); Text("Second item") }.variant("boxedListSeparate"); Text("boxedListSeparate").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListBox() { Text("First item"); Text("Second item") }.variant("navigationSidebar"); Text("navigationSidebar").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListBox() { Text("First item"); Text("Second item") }.variant("richList"); Text("richList").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListBox() { Text("First item"); Text("Second item") }.variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
}

ListBoxRow

role listitem · arguments title

Title
Source
ListBoxRow("Title")

ListView

role list · variants richList, navigationSidebar, plain

First item
Second item
richList
First item
Second item
navigationSidebar
First item
Second item
plain
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ListView() { Text("First item"); Text("Second item") }.variant("richList"); Text("richList").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListView() { Text("First item"); Text("Second item") }.variant("navigationSidebar"); Text("navigationSidebar").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ListView() { Text("First item"); Text("Second item") }.variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
}

MenuButton(icon: "open-menu", open: true) { MenuItem … }

role menu · arguments label · variants flat, suggested, circular

Label
flat
Label
suggested
Label
circular
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { MenuButton("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }.variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { MenuButton("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }.variant("suggested"); Text("suggested").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { MenuButton("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }.variant("circular"); Text("circular").font(.caption).foregroundStyle(.secondary) }
}

MenuItem("Preferences", shortcut: "Ctrl+,", checked:)

role menuitem · arguments label

Source
MenuItem("Label")

MessageDialog

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

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

NavigationPage("Title") { ToolbarView { … } }

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

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

ListBox.navigation-sidebar — NavigationSidebar(selection:) { SidebarItem("Wi-Fi", icon:) … }

role sidebar · arguments title

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

NavigationSplitView { sidebar page } content: { content page }

role split

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

Navigation stack — shows its (top) page

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

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

Overlay

role zstack

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

OverlaySplitView

OverlaySplitView { sidebar } content: { … }

role split

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

Paned

Paned { start } content: { end }

role split

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

PasswordEntry

role textfield · arguments placeholder · defaults kind: "password", reveal: True

Placeholder
Source
PasswordEntry("Placeholder")

PasswordEntryRow

PasswordEntryRow("Password", text:)

role textfield · arguments title · defaults kind: "password", reveal: True

Source
PasswordEntryRow("Title")

PathBar

Nautilus path bar: PathBar(["Home", "Projects"])

role breadcrumb · arguments items

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

Picture

role image · arguments name

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

Popover

A popover surface; place it with .overlay(alignment:)

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

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

PopoverMenu

PopoverMenu { MenuItem … } — an open menu popover

role menu · arguments label

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

PreferencesDialog

PreferencesDialog("Preferences") { PreferencesPage … }

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

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

PreferencesGroup

PreferencesGroup("Title", description:) { rows } headerSuffix: { Button }

role section · arguments title

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

PreferencesPage

PreferencesPage { PreferencesGroup … } — clamped, scrolling page of groups

role form · arguments title

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

PreferencesWindow

Preferences window (deprecated; use PreferencesDialog)

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

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

ProgressBar

ProgressBar(fraction: 0.6, showText:) — none = pulsing

role progress · arguments label · variants osd

Label
osd
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ProgressBar("Label").variant("osd"); Text("osd").font(.caption).foregroundStyle(.secondary) }
}

RadioButton

CheckButton in a group — RadioButton("Label", active: true)

role radio · arguments label

Label
Source
RadioButton("Label")

Revealer

role group

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

Scale

Scale(value: 40, in: 0...100, marks: …)

role slider · arguments label

Label
Source
Scale("Label")

ScrolledWindow

Scrolling region (static)

role scroll · arguments axes

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

SearchBar { SearchEntry(…) } — revealed under the HeaderBar

role toolbar · defaults variant: "searchbar"

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

SearchEntry

SearchEntry("Search", text:)

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

Placeholder
Source
SearchEntry("Placeholder")

Separator

role divider

Source
Separator()

ShortcutLabel

ShortcutLabel(["Ctrl", "S"])

role kbd · arguments keys

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

SidebarItem

SidebarItem("Wi-Fi", icon: "network-wireless", badge:) · .selected()

role navitem · arguments label

Label
Source
SidebarItem("Label")

SourceView

GtkSourceView 5 — SourceView("…", language: "python", lineNumbers:, highlight:)

role code · arguments code

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

SpinButton

SpinButton(value: 4)

role stepper · arguments label

Label
Source
SpinButton("Label")

SpinRow

SpinRow("Title", value: 4)

role stepper · arguments title

Title
Source
SpinRow("Title")

Spinner

Adw.Spinner — indeterminate

role progress · defaults variant: "spinner"

Source
Spinner()

SplitButton

SplitButton("Open") — button + dropdown arrow

role button · arguments label · defaults split: True

Label
Source
SplitButton("Label")

Stack

Stack(selection:) { StackPage("Name") { … } } — shows the selected page

role tabs · defaults variant: "stack"

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

StackPage

role tab · arguments title

Source
StackPage("Title")

StackSwitcher

StackSwitcher(items: ["A", "B"], selection: "A") — linked buttons

role segmented · arguments items

OneTwoThree
Source
StackSwitcher(["One", "Two", "Three"])

StatusPage

StatusPage("No Results", icon: "system-search", description:) { Button(…).variant(.pill) }

role emptystate · arguments title

Title
Source
StatusPage("Title")

Statusbar

role toolbar · defaults variant: "statusbar"

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

Switch

Switch(active: true)

role toggle · arguments label

Label
Source
Switch("Label")

SwitchRow

SwitchRow("Title", subtitle:, active: true)

role toggle · arguments title

Title
Source
SwitchRow("Title")

TabBar

TabBar(items: ["a.txt", "b.txt"], selection:)

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

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

TabPage

TabPage("Title", icon:, badge:) { … }

role tab · arguments title

Source
TabPage("Title")

TabView

TabView(selection:) { TabPage("notes.md") { … } } — Adw tab bar + pages

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

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

TextView

TextView(text:, rows:) — multi-line text area

role textfield · arguments text · defaults kind: "multiline"

Text
Source
TextView("Text")

Toast

Toast("‘Report.pdf’ moved to trash", buttonLabel: "Undo") — floats at the bottom

role toast · arguments title

Title
Source
Toast("Title")

ToastOverlay

Hosts toasts; put the content and a Toast inside

role group

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

ToggleButton

ToggleButton("Bold", active: true)

role button · arguments label

Label
Source
ToggleButton("Label")

ToggleGroup

Adw.ToggleGroup (1.7) — items:, selection:

role segmented · arguments items · variants flat, round

OneTwoThree
flat
OneTwoThree
round
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ToggleGroup(["One", "Two", "Three"]).variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ToggleGroup(["One", "Two", "Three"]).variant("round"); Text("round").font(.caption).foregroundStyle(.secondary) }
}

ToolbarView

ToolbarView { HeaderBar(…); content; bottom bar } — content between the bars fills the space

role vstack · defaults alignment: "stretch", spacing: 0 · variants flat, raised, raisedBorder

ContentAction
flat
ContentAction
raised
ContentAction
raisedBorder
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { ToolbarView() { Text("Content"); Button("Action") }.variant("flat"); Text("flat").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ToolbarView() { Text("Content"); Button("Action") }.variant("raised"); Text("raised").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { ToolbarView() { Text("Content"); Button("Action") }.variant("raisedBorder"); Text("raisedBorder").font(.caption).foregroundStyle(.secondary) }
}

TreeExpander

role treeitem · arguments label

Label
Source
TreeExpander("Label")

TreeListView

role tree

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

ViewStack

ViewStack(selection:) { ViewStackPage("Albums", icon:) { … } } — the selected page only

role tabs · defaults variant: "stack"

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

ViewStackPage

ViewStackPage("Albums", icon: "photo", badge: 3) { … }

role tab · arguments title

Source
ViewStackPage("Title")

ViewSwitcher

ViewSwitcher(selection:) { ViewSwitcherItem("World", icon:) … } — wide switcher for a HeaderBar titleWidget

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

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

ViewSwitcherBar

ViewSwitcherBar(selection:) { ViewSwitcherItem … } — the narrow/mobile bottom bar

role tabs · defaults placement: "bottom", variant: "switcherBar"

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

ViewSwitcherItem

role tab · arguments title

Source
ViewSwitcherItem("Title")

Viewport

role group

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

Window

Adw.Window / Gtk.Window

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

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

WindowTitle

WindowTitle("Document", "~/Notes") — title + subtitle for a HeaderBar titleWidget

role listitem · arguments title, subtitle

TitleSubtitle
Source
WindowTitle("Title", "Subtitle")

WrapBox

Adw.WrapBox (1.7) — wraps children onto lines

role hstack · defaults spacing: 6, wrap: True

ContentAction
Source
WrapBox() { 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)

Badge

role badge · arguments text

Text
Source
Badge("Text")

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

Canvas

free-form area; place children with .position(x:y:); grid: .dots|.lines

role canvas

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

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

DatePicker

selection: "2026-11-23"; .datePickerStyle(.graphical)

role datepicker · arguments label

Source
DatePicker("Label")

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

Ellipse

role shape · defaults shape: "ellipse"

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

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

Grid

Grid of GridRow children, or columns: n

role grid

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

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

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

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)

role menu · arguments label

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

Text
Source
MessageBubble("Text")

role navitem · arguments label

Label
Source
NavItem("Label")

role listitem · arguments title · defaults chevron: True

Title
Source
NavigationLink("Title")

Content's .navigationTitle / .toolbar form the bar

role navstack

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

Pagination

role pagination

Source
Pagination()

Picker

Picker("Size", selection: "M") { Text("S") … }

role select · arguments label

Source
Picker("Label")

PieChart

role chart · defaults kind: "pie"

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

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)

Rectangle

role shape · defaults shape: "rectangle"

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

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)

Slider

Slider(value: 0.4) or Slider(value: 30, in: 0...100)

role slider

Source
Slider()

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

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

TextEditor

role textfield · arguments text · defaults kind: "multiline"

Text
Source
TextEditor("Text")

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

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