Android · Jetpack Compose¶
Imitates: Jetpack Compose · Material 3 Expressive (baseline scheme) Compose Material 3 1.4 · Android 16 · Pack id: android · Selected by: pack="android", import Android, import JetpackCompose, import Compose, import Material3 · Default device: phone (android chrome)
118 own elements, plus 119 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¶
AlertDialog¶
AlertDialog(title: "Discard draft?", text: "…", icon: "delete", buttons: ["Cancel", "Discard"]) or confirmButton: { TextButton… }
role dialog · arguments title · defaults variant: "alert"
Source
AlertDialog("Title") { Text("Content"); Button("Action") }AssistChip¶
AssistChip("Add to calendar", leadingIcon: "event") — 32dp, 8dp corners
role chip · arguments label · defaults variant: "assist"
Source
AssistChip("Label")Badge¶
Badge() — 6dp dot; Badge("12") — 16dp large badge (error colours)
role badge · arguments text
Source
Badge("Text")BadgedBox¶
BadgedBox(badge: 3) { Icon("mail") } — badge: true for a dot
role label
Source
BadgedBox()BasicAlertDialog¶
BasicAlertDialog { custom content }
role dialog · arguments title · defaults variant: "alert"
Source
BasicAlertDialog("Title") { Text("Content"); Button("Action") }BottomAppBar¶
BottomAppBar { IconButton(…) …; Spacer(); FloatingActionButton("add", inline: true) }
role toolbar
Source
BottomAppBar() { Button("Save"); Button("Share") }Box¶
Compose Box: overlapping children; alignment:
role zstack
Source
Box() { Text("Content"); Button("Action") }Button¶
Button(onClick: {}) { Text("Save") } or Button("Save", icon:) — filled, 40dp pill
role button · arguments label · defaults variant: "filled" · variants filled, tonal, outlined, text, elevated
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("tonal"); Text("tonal").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("text"); Text("text").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("elevated"); Text("elevated").font(.caption).foregroundStyle(.secondary) }
}ButtonGroup¶
M3 Expressive ButtonGroup { ToggleButton … } (standard)
role hstack · defaults spacing: 8
Source
ButtonGroup() { Text("Content"); Button("Action") }Card¶
Card { … } — filled (surfaceContainerHighest), 12dp corners; title:, subtitle:, image:, actions:
role card · arguments title · defaults variant: "filled" · variants filled, elevated, outlined
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Card("Title") { Text("Content"); Button("Action") }.variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Card("Title") { Text("Content"); Button("Action") }.variant("elevated"); Text("elevated").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Card("Title") { Text("Content"); Button("Action") }.variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
}CarouselItem¶
CarouselItem { Image(…); Text("caption") } — a masked carousel item with an overlay label
role zstack · defaults alignment: "bottomLeading"
Source
CarouselItem() { Text("Content"); Button("Action") }CenterAlignedTopAppBar¶
CenterAlignedTopAppBar(title:, navigationIcon:, actions:)
role appbar · arguments title · defaults variant: "centerAligned"
Source
CenterAlignedTopAppBar("Title") { Text("Content"); Button("Action") }Checkbox¶
Checkbox(checked: true) (label optional, Compose puts it in a Row)
role checkbox · arguments label
Source
Checkbox("Label")CircularProgressIndicator¶
CircularProgressIndicator(progress: 0.7)
role progress · defaults variant: "circular"
Source
CircularProgressIndicator()CircularWavyProgressIndicator¶
M3 Expressive wavy circular indicator
role progress · defaults variant: "circular"
Source
CircularWavyProgressIndicator()Column¶
Compose Column (vertical layout); spacing:, alignment:
role vstack · defaults alignment: "leading"
Source
Column() { Text("Content"); Button("Action") }ConnectedButtonGroup¶
M3 Expressive connected button group: ToggleButtons with shared inner corners
role hstack · defaults spacing: 2
Source
ConnectedButtonGroup() { Text("Content"); Button("Action") }DatePicker¶
DatePicker(selection: "2026-11-27") — month grid, selected day in a primary circle, today outlined
role calendar · defaults showToday: True
Source
DatePicker()DatePickerDialog¶
DatePickerDialog(actions: { TextButton("Cancel"); TextButton("OK") }) { DatePicker(…) }
role dialog · arguments title · defaults variant: "picker"
Source
DatePickerDialog("Title") { Text("Content"); Button("Action") }DatePickerField¶
a date text field with a calendar icon: DatePickerField("Date", selection:)
role datepicker · arguments label · defaults variant: "outlined"
Source
DatePickerField("Label")DateRangePicker¶
DateRangePicker(range: ["2026-11-23", "2026-11-27"])
role calendar · defaults showToday: True
Source
DateRangePicker()Dialog¶
Dialog { Card { … } } — a custom dialog window
role dialog · arguments title · defaults variant: "alert"
Source
Dialog("Title") { Text("Content"); Button("Action") }DismissibleNavigationDrawer¶
an open dismissible drawer beside the content
role sidebar · defaults variant: "drawer"
Source
DismissibleNavigationDrawer() { Text("Content"); Button("Action") }DockedSearchBar¶
DockedSearchBar("Search", query:)
role textfield · arguments placeholder · defaults kind: "search", variant: "docked"
Source
DockedSearchBar("Placeholder")DropdownMenu¶
DropdownMenu(expanded: true) { DropdownMenuItem("Edit", leadingIcon: "edit") } — label:/icon: give it an anchor
role menu · arguments label
Source
DropdownMenu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownMenuItem¶
DropdownMenuItem("Share", leadingIcon: "share", trailingText: "⌘S")
role menuitem · arguments label
Source
DropdownMenuItem("Label")ElevatedAssistChip¶
elevated assist chip
role chip · arguments label · defaults elevation: "1", variant: "assist"
Source
ElevatedAssistChip("Label")ElevatedButton¶
surfaceContainerLow pill button with level-1 shadow
role button · arguments label · defaults variant: "elevated"
Source
ElevatedButton("Label")ElevatedCard¶
ElevatedCard: surfaceContainerLow + level-1 shadow
role card · arguments title · defaults variant: "elevated"
Source
ElevatedCard("Title") { Text("Content"); Button("Action") }ElevatedFilterChip¶
elevated filter chip
role chip · arguments label · defaults elevation: "1", variant: "filter"
Source
ElevatedFilterChip("Label")ElevatedSuggestionChip¶
elevated suggestion chip
role chip · arguments label · defaults elevation: "1", variant: "suggestion"
Source
ElevatedSuggestionChip("Label")ExposedDropdownMenuBox¶
ExposedDropdownMenuBox("Country", value: "Portugal", options: [..], expanded: true)
role select · arguments label · defaults variant: "filled"
Source
ExposedDropdownMenuBox("Label")ExtendedFloatingActionButton¶
ExtendedFloatingActionButton("Compose", icon: "edit") — 56dp, label + icon
role fab · arguments label
Source
ExtendedFloatingActionButton("Label")FilledIconButton¶
FilledIconButton("add")
role button · arguments icon · defaults iconOnly: True, variant: "filled"
Source
FilledIconButton("star")FilledTonalButton¶
secondaryContainer pill button
role button · arguments label · defaults variant: "tonal"
Source
FilledTonalButton("Label")FilledTonalIconButton¶
FilledTonalIconButton("edit")
role button · arguments icon · defaults iconOnly: True, variant: "tonal"
Source
FilledTonalIconButton("star")FilterChip¶
FilterChip("Nature", selected: true) — check icon when selected
role chip · arguments label · defaults variant: "filter"
Source
FilterChip("Label")FloatingActionButton¶
FloatingActionButton("add") — 56dp, 16dp corners, primaryContainer; floats bottom-end (inline: true to place in flow)
role fab · arguments icon
Source
FloatingActionButton("star")FlowRow¶
FlowRow { … } — wraps its children (chips)
role hstack · defaults spacing: 8, wrap: True
Source
FlowRow() { Text("Content"); Button("Action") }HorizontalCenteredHeroCarousel¶
M3 Expressive hero carousel: one large centred item between two small ones
role hstack · defaults spacing: 8, variant: "hero"
Source
HorizontalCenteredHeroCarousel() { Text("Content"); Button("Action") }HorizontalDivider¶
HorizontalDivider() — 1dp outlineVariant; .variant(.inset) for a 16dp inset
role divider
Source
HorizontalDivider()HorizontalFloatingToolbar¶
M3 Expressive floating toolbar: a pill of IconButtons
role toolbar · defaults variant: "floating"
Source
HorizontalFloatingToolbar() { Button("Save"); Button("Share") }HorizontalMultiBrowseCarousel¶
HorizontalMultiBrowseCarousel { Image(…) … } — large, medium and small items with 28dp corners
role hstack · defaults spacing: 8, variant: "multiBrowse"
Source
HorizontalMultiBrowseCarousel() { Text("Content"); Button("Action") }HorizontalUncontainedCarousel¶
HorizontalUncontainedCarousel { Image(…) … } — equal-width items
role hstack · defaults spacing: 8, variant: "uncontained"
Source
HorizontalUncontainedCarousel() { Text("Content"); Button("Action") }Icon¶
Icon("favorite") — Material Symbols names (snake_case) map onto built-in glyphs
role icon · arguments name
Source
Icon("star")IconButton¶
IconButton("more_vert") — 40dp touch target, on-surface-variant icon; selected: for toggles
role button · arguments icon · defaults iconOnly: True, variant: "standard"
Source
IconButton("star")IconToggleButton¶
IconToggleButton("star", selected: true)
role button · arguments icon · defaults iconOnly: True, variant: "standard"
Source
IconToggleButton("star")InputChip¶
InputChip("Ana Lima", avatar: "Ana Lima") — trailing close icon
role chip · arguments label · defaults removable: True, variant: "input"
Source
InputChip("Label")LargeFlexibleTopAppBar¶
M3 Expressive LargeFlexibleTopAppBar(title:, subtitle:)
role appbar · arguments title · defaults variant: "large"
Source
LargeFlexibleTopAppBar("Title") { Text("Content"); Button("Action") }LargeFloatingActionButton¶
96dp, 28dp corners
role fab · arguments icon · defaults size: "large"
Source
LargeFloatingActionButton("star")LargeTopAppBar¶
LargeTopAppBar: 152dp, headlineMedium title below the icons
role appbar · arguments title · defaults variant: "large"
Source
LargeTopAppBar("Title") { Text("Content"); Button("Action") }LazyColumn¶
LazyColumn { … } — a vertically scrolling column
role scroll
Source
LazyColumn() { Text("Content"); Button("Action") }LazyRow¶
LazyRow { … } — a horizontally scrolling row
role scroll · defaults axes: "horizontal"
Source
LazyRow() { Text("Content"); Button("Action") }LazyVerticalGrid¶
LazyVerticalGrid(columns: 3, spacing:) { … }
role grid · arguments columns
Source
LazyVerticalGrid(["Name", "Status"]) { Text("Content"); Button("Action") }LeadingIconTab¶
LeadingIconTab("Mail", icon:) (rendered like Tab)
role tab · arguments label
Source
LeadingIconTab("Label")LinearProgressIndicator¶
LinearProgressIndicator(progress: 0.6) — no progress: indeterminate
role progress
Source
LinearProgressIndicator()LinearWavyProgressIndicator¶
M3 Expressive wavy linear indicator (progress:)
role progress · defaults variant: "wavy"
Source
LinearWavyProgressIndicator()ListDetailPaneScaffold¶
adaptive list–detail: ListDetailPaneScaffold { listPane; detailPane } (two children)
role split
Source
ListDetailPaneScaffold() { Text("Content"); Button("Action") }ListItem¶
ListItem(headlineContent: "Ana", supportingContent:, overlineContent:, leadingContent: { Avatar(…) }, trailingContent: { Text("9:41") }) — or title/subtitle/avatar:/icon:
role listitem · arguments title
Source
ListItem("Title")LoadingIndicator¶
M3 Expressive LoadingIndicator (shown as a spinner)
role progress · defaults variant: "circular"
Source
LoadingIndicator()MediumFlexibleTopAppBar¶
M3 Expressive MediumFlexibleTopAppBar(title:, subtitle:)
role appbar · arguments title · defaults variant: "medium"
Source
MediumFlexibleTopAppBar("Title") { Text("Content"); Button("Action") }MediumFloatingActionButton¶
M3 Expressive 80dp FAB, 20dp corners
role fab · arguments icon · defaults size: "medium"
Source
MediumFloatingActionButton("star")MediumTopAppBar¶
MediumTopAppBar: 112dp, headlineSmall title below the icons
role appbar · arguments title · defaults variant: "medium"
Source
MediumTopAppBar("Title") { Text("Content"); Button("Action") }ModalBottomSheet¶
ModalBottomSheet { … } — 28dp top corners, drag handle, over a scrim
role dialog · arguments title · defaults variant: "sheet"
Source
ModalBottomSheet("Title") { Text("Content"); Button("Action") }ModalDrawerSheet¶
the sheet of an open ModalNavigationDrawer (same rendering)
role dialog · defaults variant: "drawer"
Source
ModalDrawerSheet() { Text("Content"); Button("Action") }ModalNavigationDrawer¶
an open modal drawer over the screen: ModalNavigationDrawer { Text("Mail"); NavigationDrawerItem(…) }
role dialog · defaults variant: "drawer"
Source
ModalNavigationDrawer() { Text("Content"); Button("Action") }MultiChoiceSegmentedButtonRow¶
MultiChoiceSegmentedButtonRow (renders one selection: selection:)
role segmented · arguments items
Source
MultiChoiceSegmentedButtonRow(["One", "Two", "Three"])NavigationBar¶
NavigationBar { NavigationBarItem("Mail", icon: "mail", selected: true, badge: 3) … }
role tabs · defaults placement: "bottom"
Source
NavigationBar() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }NavigationBarItem¶
label, icon:, selected:, badge: (number, or true for a dot)
role tab · arguments label
Source
NavigationBarItem("Label")NavigationDrawerItem¶
label, icon:, selected:, badge: (shown as trailing text)
role navitem · arguments label
Source
NavigationDrawerItem("Label")NavigationRail¶
NavigationRail(header: { FloatingActionButton("edit", inline: true) }) { NavigationRailItem(…) }
role sidebar · defaults variant: "rail"
Source
NavigationRail() { Text("Content"); Button("Action") }NavigationRailItem¶
label, icon:, selected:, badge:
role navitem · arguments label
Source
NavigationRailItem("Label")NavigationSuiteScaffold¶
adaptive navigation: NavigationSuiteScaffold { NavigationRail { … }; content }
role split
Source
NavigationSuiteScaffold() { Text("Content"); Button("Action") }OutlinedButton¶
outline-bordered pill button
role button · arguments label · defaults variant: "outlined"
Source
OutlinedButton("Label")OutlinedCard¶
OutlinedCard: surface with an outlineVariant border
role card · arguments title · defaults variant: "outlined"
Source
OutlinedCard("Title") { Text("Content"); Button("Action") }OutlinedExposedDropdownMenuBox¶
an ExposedDropdownMenuBox holding an OutlinedTextField
role select · arguments label · defaults variant: "outlined"
Source
OutlinedExposedDropdownMenuBox("Label")OutlinedIconButton¶
OutlinedIconButton("share")
role button · arguments icon · defaults iconOnly: True, variant: "outlined"
Source
OutlinedIconButton("star")OutlinedSecureTextField¶
OutlinedSecureTextField("Password", value:, reveal:)
role textfield · arguments label · defaults kind: "password", variant: "outlined"
Source
OutlinedSecureTextField("Label")OutlinedTextField¶
OutlinedTextField("Email", value:, supportingText:, isError:, leadingIcon:, trailingIcon:)
role textfield · arguments label · defaults variant: "outlined"
Source
OutlinedTextField("Label")PermanentDrawerSheet¶
a permanent drawer sheet
role sidebar · defaults variant: "drawer"
Source
PermanentDrawerSheet() { Text("Content"); Button("Action") }PermanentNavigationDrawer¶
PermanentDrawerSheet beside the content (tablets)
role sidebar · defaults variant: "drawer"
Source
PermanentNavigationDrawer() { Text("Content"); Button("Action") }PlainTooltip¶
PlainTooltip("Delete") { IconButton("delete") }
role tooltip · arguments text
Source
PlainTooltip("Text") { Text("Content"); Button("Action") }PrimaryScrollableTabRow¶
PrimaryScrollableTabRow(selectedTabIndex:)
role tabs · arguments items · defaults placement: "top", variant: "scrollable"
Source
PrimaryScrollableTabRow(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }PrimaryTabRow¶
PrimaryTabRow(selectedTabIndex:) { Tab(…) } — content-width indicator, primary colour
role tabs · arguments items · defaults placement: "top", variant: "primary"
Source
PrimaryTabRow(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }RadioButton¶
RadioButton(selected: true) (label optional)
role radio · arguments label
Source
RadioButton("Label")RichTooltip¶
RichTooltip("Title", message: "…", actions: { TextButton("Learn more") }) { anchor }
role tooltip · arguments text · defaults variant: "rich"
Source
RichTooltip("Text") { Text("Content"); Button("Action") }Scaffold¶
Scaffold { TopAppBar(…); content; NavigationBar { … } } — fills the screen; FABs float over it
role vstack · defaults alignment: "stretch", spacing: 0
Source
Scaffold() { Text("Content"); Button("Action") }ScrollableTabRow¶
ScrollableTabRow / PrimaryScrollableTabRow
role tabs · arguments items · defaults placement: "top", variant: "scrollable"
Source
ScrollableTabRow(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }SearchBar¶
SearchBar("Search in mail", leadingIcon: "menu", trailingIcon: "account_circle", query:) — 56dp pill
role textfield · arguments placeholder · defaults kind: "search", variant: "searchbar"
Source
SearchBar("Placeholder")SecondaryTabRow¶
SecondaryTabRow(selectedTabIndex:) — full-width 2dp indicator, on-surface text
role tabs · arguments items · defaults placement: "top", variant: "secondary"
Source
SecondaryTabRow(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }SecureTextField¶
SecureTextField("Password", value:) — masked
role textfield · arguments label · defaults kind: "password", variant: "filled"
Source
SecureTextField("Label")SegmentedButton¶
SegmentedButton("Week") inside a SegmentedButtonRow; the row's selection: picks it
role button · arguments label
Source
SegmentedButton("Label")ShortNavigationBar¶
M3 Expressive ShortNavigationBar (64dp); same items as NavigationBar
role tabs · defaults placement: "bottom", variant: "short"
Source
ShortNavigationBar() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }ShortNavigationBarItem¶
label, icon:, selected:, badge:
role tab · arguments label
Source
ShortNavigationBarItem("Label")SingleChoiceSegmentedButtonRow¶
SingleChoiceSegmentedButtonRow(selection: "Week") { SegmentedButton("Day") … } or (["Day", "Week"], selection: 1)
role segmented · arguments items
Source
SingleChoiceSegmentedButtonRow(["One", "Two", "Three"])Slider¶
Slider(value: 0.4) or (value: 30, in: 0...100, steps: 4, ticks: true) — M3 Expressive bar handle
role slider
Source
Slider()SmallFloatingActionButton¶
40dp, 12dp corners
role fab · arguments icon · defaults size: "small"
Source
SmallFloatingActionButton("star")Snackbar¶
Snackbar("Message archived", action: "Undo") — inverseSurface; inline: true to place in flow
role toast · arguments message
Source
Snackbar("Message")SuggestionChip¶
SuggestionChip("Sounds good!")
role chip · arguments label · defaults variant: "suggestion"
Source
SuggestionChip("Label")Surface¶
Surface(color:, tonalElevation:) { … } — a plain M3 surface; .elevation(1…5) adds tonal elevation
role vstack · defaults alignment: "stretch", spacing: 0
Source
Surface() { Text("Content"); Button("Action") }Switch¶
Switch(checked: true) — 52×32 track, check icon in the thumb when on (thumbContent)
role toggle · arguments label
Source
Switch("Label")Tab¶
Tab("Photos", icon: "photo", selected:) { panel content }
role tab · arguments label
Source
Tab("Label")TabRow¶
TabRow(selectedTabIndex: 0) { Tab("Photos", icon:) … } or TabRow(["A", "B"])
role tabs · arguments items · defaults placement: "top", variant: "primary"
Source
TabRow(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }TextButton¶
text-only button (dialog actions, card actions)
role button · arguments label · defaults variant: "text"
Source
TextButton("Label")TextField¶
TextField("Label", value:, placeholder:, supportingText:, isError:, leadingIcon: "search", trailingIcon:) — filled
role textfield · arguments label · defaults variant: "filled" · variants filled, outlined
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { TextField("Label").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { TextField("Label").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
}TimeInput¶
TimeInput("Time", selection: "10:30 AM")
role datepicker · arguments label · defaults kind: "time", variant: "outlined"
Source
TimeInput("Label")TimePicker¶
TimePicker(hour: "10") — the 256dp clock dial with the selected hour
role radiogroup · defaults options: ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"], variant: "dial"
Source
TimePicker()TimePickerDialog¶
TimePickerDialog(title: "Select time", actions:) { TimePicker(hour: "10") }
role dialog · arguments title · defaults variant: "picker"
Source
TimePickerDialog("Title") { Text("Content"); Button("Action") }ToggleButton¶
M3 Expressive ToggleButton("Bold", checked: true)
role button · arguments label · defaults variant: "toggle"
Source
ToggleButton("Label")Tooltip¶
plain tooltip: Tooltip("Add to favorites") { IconButton("star") }
role tooltip · arguments text
Source
Tooltip("Text") { Text("Content"); Button("Action") }TooltipBox¶
TooltipBox("Label") { anchor }
role tooltip · arguments text
Source
TooltipBox("Text") { Text("Content"); Button("Action") }TopAppBar¶
TopAppBar(title: "Inbox", navigationIcon: { IconButton("menu") }, actions: { IconButton("search") }) — 64dp small bar
role appbar · arguments title · defaults variant: "small"
Source
TopAppBar("Title") { Text("Content"); Button("Action") }TopSearchBar¶
M3 Expressive TopSearchBar (app bar with search)
role textfield · arguments placeholder · defaults kind: "search", variant: "searchbar"
Source
TopSearchBar("Placeholder")TriStateCheckbox¶
TriStateCheckbox(state: .indeterminate | .on | .off)
role checkbox · arguments label
Source
TriStateCheckbox("Label")VerticalSlider¶
M3 Expressive VerticalSlider (rendered horizontally)
role slider
Source
VerticalSlider()WideNavigationRail¶
M3 Expressive WideNavigationRail (collapsed)
role sidebar · defaults variant: "rail"
Source
WideNavigationRail() { 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])Canvas¶
free-form area; place children with .position(x:y:); grid: .dots|.lines
role canvas
Source
Canvas() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)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") }DisclosureGroup¶
role accordion · arguments title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }EmptyState¶
title, systemImage:, description: { actions }
role emptystate · arguments title
Source
EmptyState("Title")Form¶
role form
Source
Form() { TextField("Name"); Toggle("Notifications", isOn: true) }Gantt¶
scale: ["W1",…], tasks: [("Design", 0, 2, 0.6), …], today:
role gantt
Source
Gantt(tasks: [("Design", 0, 3), ("Build", 2, 5)])Grid¶
Grid of GridRow children, or columns: n
role grid
Source
Grid() { Text("Content"); Button("Action") }GroupBox¶
role card · arguments title
Source
GroupBox("Title") { Text("Content"); Button("Action") }HStack¶
Horizontal stack. spacing:, alignment: .top|.center|.bottom
role hstack
Source
HStack() { Text("Content"); Button("Action") }Image¶
Image("path.png") or Image(systemName: "star")
role image · arguments name
Source
Image().frame(width: 160, height: 96)KanbanCard¶
title, description:, tags: [..], assignees: [..], due:, comments:, priority:
role kanbancard · arguments title
Source
KanbanCard("Title")LabeledContent¶
role labeled · arguments label, value
Source
LabeledContent("Label", "Value") { Text("Content"); Button("Action") }LazyVGrid¶
columns: [GridItem(.flexible()), …] or a count
role grid
Source
LazyVGrid() { Text("Content"); Button("Action") }List¶
.listStyle(.insetGrouped|.plain|.sidebar|…)
role list
Source
List() { Text("First item"); Text("Second item") }Map¶
pins: [(x%, y%, "label")], route:, showsUserLocation:, height:
role map
Source
Map().frame(width: 160, height: 96)Menu¶
role menu · arguments label
Source
Menu("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }MessageBubble¶
MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])
role message · arguments text
Source
MessageBubble("Text")NavigationLink¶
role listitem · arguments title · defaults chevron: True
Source
NavigationLink("Title")NavigationSplitView¶
{ sidebar } content: { … } detail: { … }
role split
Source
NavigationSplitView() { Text("Content"); Button("Action") }NavigationStack¶
Content's .navigationTitle / .toolbar form the bar
role navstack
Source
NavigationStack() { Text("Content"); Button("Action") }Picker¶
Picker("Size", selection: "M") { Text("S") … }
role select · arguments label
Source
Picker("Label")Placeholder¶
A labelled box for maps, charts, media
role placeholder · arguments label
Source
Placeholder("Label").frame(width: 160, height: 96)Pointer¶
Pointer(.arrow|.hand|.ibeam|.grab|.crosshair|.touch); place with .position
role pointer · arguments kind
Source
Pointer(.arrow)ProgressView¶
value: 0…1 (or total:); none = indeterminate
role progress · arguments label
Source
ProgressView("Label")RoundedRectangle¶
role shape · defaults shape: "rounded"
Source
RoundedRectangle().frame(width: 160, height: 96)Row¶
title, subtitle:, detail:, systemImage:, chevron:
role listitem · arguments title
Source
Row("Title")Schedule¶
days: [..], startHour:, endHour:, events: [("Standup", "Mon", 9, 9.5, .blue)], now:
role schedule
Source
Schedule()ScrollView¶
role scroll · arguments axes
Source
ScrollView() { Text("Content"); Button("Action") }SearchField¶
role textfield · arguments placeholder · defaults kind: "search"
Source
SearchField("Placeholder")Section¶
Section("Header") { … } footer: { … }
role section · arguments title
Source
Section("Title") { Text("First item"); Text("Second item") }SecureField¶
role textfield · arguments placeholder · defaults kind: "password"
Source
SecureField("Placeholder")SegmentedControl¶
role segmented · arguments items
Source
SegmentedControl(["One", "Two", "Three"])SelectionRect¶
a drag-selection rectangle; size with .frame, place with .position
role marquee
Source
SelectionRect()Sheet¶
role dialog · arguments title · defaults variant: "sheet"
Source
Sheet("Title") { Text("Content"); Button("Action") }Sidebar¶
role sidebar · arguments title
Source
Sidebar("Title") { Text("Content"); Button("Action") }Skeleton¶
lines:, avatar:, image:, shape: .circle|.rectangle|.text
role skeleton
Source
Skeleton().frame(width: 160, height: 96)Sparkline¶
role chart · arguments values · defaults kind: "sparkline"
Source
Sparkline([3, 5, 2, 6, 4], values: [3, 5, 2, 6, 4])Spreadsheet¶
rows: [[…]], selection: "B2:C4", active:, formula:, sheets: [..], highlight: ["B3": .yellow]
role spreadsheet
| A | B | |
|---|---|---|
| 1 | A | B |
| 2 | 1 | 2 |
| 3 | 3 | 4 |
Source
Spreadsheet(columns: ["A", "B"], rows: [[1, 2], [3, 4]])Stat¶
Stat("Revenue", "$48k", change: "+12%", trend: [..], systemImage:)
role stat · arguments label, value
Source
Stat("Label", 60)Steps¶
role steps · arguments steps
Source
Steps(["Cart", "Shipping", "Payment"])StickyNote¶
StickyNote("Call Ana", color: .yellow, rotation: -2, author:)
role stickynote · arguments text
Source
StickyNote("Text")TabView¶
Children with .tabItem { Label } or Tab(…)
role tabs · defaults placement: "bottom"
Source
TabView() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }Table¶
columns: ["Name", …], rows: [[…], …] or TableRow children
role table
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]])Tabs¶
role tabs · arguments items · defaults placement: "top"
Source
Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }Terminal¶
lines starting with "$ " are commands
role code · arguments code · defaults variant: "terminal"
Source
Terminal("let total = items.count")Text¶
Text with bold, italic, code Markdown
role text · arguments content
Source
Text("Content")TextEditor¶
role textfield · arguments text · defaults kind: "multiline"
Source
TextEditor("Text")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") }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") }