Tailwind Catalyst¶
Imitates: Catalyst — the Tailwind Plus application UI kit (Headless UI + Tailwind CSS v4), zinc neutrals, plus Tailwind Plus marketing sections Catalyst 2025 · Tailwind CSS 4.1 · Pack id: tailwind · Selected by: pack="tailwind", import Tailwind, import TailwindPlus, import TailwindCatalyst · Default device: desktop (browser chrome)
107 own elements, plus 115 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¶
Alert¶
Catalyst Alert: a small centred confirmation modal. Alert("Are you sure?", description: "…") actions: { … }
role dialog · arguments title · defaults size: "md", variant: "alert"
Source
Alert("Title") { Text("Content"); Button("Action") }AlertActions¶
Alert actions
role hstack · defaults spacing: 12
Source
AlertActions() { Text("Content"); Button("Action") }AlertBody¶
Alert body
role vstack · defaults alignment: "stretch"
Source
AlertBody() { Text("Content"); Button("Action") }AlertDescription¶
Alert description
role text · arguments content
Source
AlertDescription("Content")AuthLayout¶
Centred sign-in page on an inset panel: AuthLayout { VStack { … } }
role vstack · defaults spacing: 0
Source
AuthLayout() { Text("Content"); Button("Action") }Avatar¶
Avatar("Erica Jones", src: "…") · initials: "EJ" · square: true
role avatar · arguments name
Source
Avatar("Ana Lima")AvatarButton¶
An Avatar that is a button (e.g. a dropdown trigger)
role avatar · arguments name
Source
AvatarButton("Ana Lima")Badge¶
Badge("Paid", color: .lime) — rounded-md tinted pill; any Tailwind colour (zinc default)
role badge · arguments text · defaults color: "zinc"
Source
Badge("Text")BadgeButton¶
A Badge that is a link/button
role badge · arguments text · defaults color: "zinc"
Source
BadgeButton("Text")Button¶
Button("Save", color: .indigo) · variant: .solid|.outline|.plain (or .outline() / .plain()) · color: dark/zinc (default), light, dark, white, dark/white, zinc, indigo, red, … all Tailwind hues
role button · arguments label · defaults variant: "solid" · variants solid, outline, plain
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("solid"); Text("solid").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("outline"); Text("outline").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("plain"); Text("plain").font(.caption).foregroundStyle(.secondary) }
}Checkbox¶
Checkbox("Allow embedding", checked: true, color: .indigo) · indeterminate via checked: .indeterminate
role checkbox · arguments label
Source
Checkbox("Label")CheckboxField¶
CheckboxField("Allow embedding", description: "…", checked: true) — checkbox, label and description
role listitem · arguments title · defaults checked: False
Source
CheckboxField("Title")CheckboxGroup¶
Stack of CheckboxFields (space-y-3)
role vstack · defaults alignment: "stretch", spacing: 12
Source
CheckboxGroup() { Text("Content"); Button("Action") }Code¶
Code("…") — inline code with a hairline border
role text · arguments content
Source
Code("Content")Combobox¶
Combobox("Search…", selection: "Can", open: true) { ComboboxOption(…) } — a text input with a listbox
role select · arguments placeholder · defaults trailingIcon: "chevron.up.down"
Source
Combobox("Placeholder")ComboboxDescription¶
Option description
role text · arguments content
Source
ComboboxDescription("Content")Description¶
Field description (zinc-500)
role text · arguments content
Source
Description("Content")DescriptionDetails¶
Details (zinc-950)
role text · arguments content
Source
DescriptionDetails("Content")DescriptionList¶
DescriptionList { DescriptionTerm("Customer"); DescriptionDetails("Leslie Alexander") … } — two columns on desktop
role grid
Source
DescriptionList() { Text("Content"); Button("Action") }DescriptionTerm¶
Term (zinc-500)
role text · arguments content
Source
DescriptionTerm("Content")Dialog¶
Dialog("Refund payment", description: "…") { DialogBody … } actions: { Button("Cancel", variant: .plain); Button("Refund") } · size: .sm…5xl
role dialog · arguments title · defaults size: "lg"
Source
Dialog("Title") { Text("Content"); Button("Action") }DialogActions¶
Right-aligned actions (gap-3)
role hstack · defaults spacing: 12
Source
DialogActions() { Text("Content"); Button("Action") }DialogBody¶
Dialog body (mt-6)
role vstack · defaults alignment: "stretch", spacing: 16
Source
DialogBody() { Text("Content"); Button("Action") }DialogDescription¶
Dialog description
role text · arguments content
Source
DialogDescription("Content")Divider¶
Divider() · Divider(soft: true) for the lighter zinc-950/5 rule
role divider
Source
Divider()Dropdown¶
Dropdown("Options", open: true) { DropdownItem("Edit", shortcut: "⌘E") … } · trigger variant: .outline (default)|.plain|.solid
role menu · arguments label · defaults variant: "outline"
Source
Dropdown("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownButton¶
Same as Dropdown (Catalyst names the trigger DropdownButton)
role menu · arguments label · defaults variant: "outline"
Source
DropdownButton("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownDescription¶
Item description
role text · arguments content
Source
DropdownDescription("Content")DropdownHeader¶
Non-interactive header block (px-3.5 pt-2.5 pb-1)
role vstack · defaults alignment: "leading", spacing: 0
Source
DropdownHeader() { Text("Content"); Button("Action") }DropdownHeading¶
Section heading (xs/5 medium zinc-500)
role text · arguments content
Source
DropdownHeading("Content")DropdownItem¶
DropdownItem("Settings", systemImage: "cog-6-tooth", shortcut: "⌘S") · .state(.focused) for the blue highlight
role menuitem · arguments label
Source
DropdownItem("Label")DropdownMenu¶
An open dropdown panel on its own (place it with .offset)
role menu
Source
DropdownMenu() { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownSection¶
A group of items
role group
Source
DropdownSection() { Text("Content"); Button("Action") }DropdownShortcut¶
DropdownShortcut(keys: ["⌘", "K"])
role kbd · arguments keys
Source
DropdownShortcut(["⌘", "K"])EmptyState¶
Tailwind Plus empty state: dashed box, icon, title, description and a button
role emptystate · arguments title
Source
EmptyState("Title")ErrorMessage¶
Field error (red-600)
role text · arguments content
Source
ErrorMessage("Content")Eyebrow¶
Small indigo kicker above a section title (or a pill announcement with variant: .pill)
role text · arguments content · variants pill
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Eyebrow("Content").variant("pill"); Text("pill").font(.caption).foregroundStyle(.secondary) }
}Feature¶
Feature("Push to deploy", description: "…", systemImage: "cloud-arrow-up") — indigo icon tile + title + text
role listitem · arguments title
Source
Feature("Title")FeatureGrid¶
Feature section grid: FeatureGrid(columns: 3) { Feature(…) … }
role grid · defaults columns: 3, spacing: 40
Source
FeatureGrid() { Text("Content"); Button("Action") }Field¶
Field { Label("Email"); Input(…); Description(…) }
role vstack · defaults alignment: "stretch", spacing: 12
Source
Field() { Text("Content"); Button("Action") }FieldGroup¶
Stack of fields (space-y-8)
role vstack · defaults alignment: "stretch", spacing: 32
Source
FieldGroup() { Text("Content"); Button("Action") }Fieldset¶
Fieldset { Legend(…); Text(…); FieldGroup { Field { … } } }
role vstack · defaults alignment: "stretch", spacing: 0
Source
Fieldset() { Text("Content"); Button("Action") }Heading¶
Heading("Orders") — text-2xl/8 sm:text-xl/8 semibold · level: 1…6
role text · arguments content · defaults style: "title2"
Source
Heading("Content")Hero¶
Marketing hero (simple centred): Hero { Eyebrow(…); Text(…).font(.display); Lead(…); HStack { Button… } }
role vstack · defaults spacing: 24
Source
Hero() { Text("Content"); Button("Action") }HeroHeading¶
Hero title (text-6xl semibold tracking-tight, balanced)
role text · arguments content
Source
HeroHeading("Content")InlineAlert¶
Tailwind Plus “Alerts” banner: InlineAlert("Attention needed", message: "…", severity: .warning) · variant: .accent for a left border
role alert · arguments title · variants accent
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { InlineAlert("Title").variant("accent"); Text("accent").font(.caption).foregroundStyle(.secondary) }
}Input¶
Input("you@example.com", label:, description:, text:, type: .email|.password|.search) · invalid: true
role textfield · arguments placeholder
Source
Input("Placeholder")InputGroup¶
Input with a leading icon: InputGroup("Search…", systemImage: "magnifying-glass")
role textfield · arguments placeholder
Source
InputGroup("Placeholder")Label¶
Label("Full name") — form label (sm/6 medium)
role label · arguments title
Source
Label("Title")Lead¶
Large muted intro paragraph (text-lg/8)
role text · arguments content
Source
Lead("Content")Legend¶
Fieldset legend (base/6 semibold)
role text · arguments content
Source
Legend("Content")Link¶
Link("View") — unstyled link (inherits colour)
role link · arguments label
Source
Link("Label")Listbox¶
Listbox("Select a status", selection: "Active", open: true) { ListboxOption("Active") … }
role select · arguments placeholder · defaults trailingIcon: "chevron.up.down"
Source
Listbox("Placeholder")ListboxDescription¶
Option description
role text · arguments content
Source
ListboxDescription("Content")Navbar¶
Navbar { NavbarSection { NavbarItem("Home", current: true) }; NavbarSpacer(); NavbarItem(systemImage:) }
role toolbar
Source
Navbar() { Button("Save"); Button("Share") }NavbarItem¶
NavbarItem("Orders", systemImage:, current: true) — the current item gets an underline bar
role navitem · arguments label
Source
NavbarItem("Label")NavbarLabel¶
Text inside a navbar item
role text · arguments content
Source
NavbarLabel("Content")NavbarSection¶
Group of navbar items
role hstack · defaults spacing: 12
Source
NavbarSection() { Text("Content"); Button("Action") }Notification¶
Tailwind Plus notification panel (top right): Notification("Successfully saved!", description: "…", systemImage: "check-circle")
role toast · arguments message · defaults closable: True, position: "top-right"
Source
Notification("Message")Pagination¶
Pagination(count: 10, page: 2) — Previous · pages · Next, spread over the width
role pagination
Source
Pagination()PricingGrid¶
Row of PricingTier cards
role grid · defaults columns: 3, spacing: 32
Source
PricingGrid() { Text("Content"); Button("Action") }PricingTier¶
PricingTier("Startup", description: "…", featured: true) { price, features } actions: { Button }
role card · arguments title
Source
PricingTier("Title") { Text("Content"); Button("Action") }RadioGroup¶
RadioGroup(selection: "Monthly") { Radio("Monthly"); Radio("Yearly") }
role radiogroup · arguments label
Source
RadioGroup("Label") { Radio("First", selected: true); Radio("Second") }SectionHeading¶
Marketing section title (text-4xl semibold tracking-tight)
role text · arguments content
Source
SectionHeading("Content")Select¶
Native select: Select("Country", selection: "Canada") { … }
role select · arguments placeholder · defaults trailingIcon: "chevron.up.down"
Source
Select("Placeholder")Sidebar¶
Sidebar { SidebarHeader { … }; SidebarBody { SidebarSection { SidebarItem(…) } }; SidebarFooter { … } }
role sidebar
Source
Sidebar() { Text("Content"); Button("Action") }SidebarBody¶
Scrolling middle block
role vstack · defaults alignment: "stretch", spacing: 32
Source
SidebarBody() { Text("Content"); Button("Action") }SidebarFooter¶
Bottom block with a top border
role vstack · defaults alignment: "stretch", spacing: 0
Source
SidebarFooter() { Text("Content"); Button("Action") }SidebarHeader¶
Top block with a bottom border
role vstack · defaults alignment: "stretch", spacing: 0
Source
SidebarHeader() { Text("Content"); Button("Action") }SidebarHeading¶
SidebarHeading("Upcoming events") — xs zinc-500 section title
role text · arguments content
Source
SidebarHeading("Content")SidebarItem¶
SidebarItem("Home", systemImage: "home", current: true) — current: indicator bar on the left
role navitem · arguments label
Source
SidebarItem("Label")SidebarLabel¶
Label inside a sidebar item
role text · arguments content
Source
SidebarLabel("Content")SidebarLayout¶
App shell: SidebarLayout { Sidebar { … }; VStack { page } } — the page sits on a white panel with a ring, inset on zinc-100
role hstack · defaults alignment: "stretch", spacing: 0
Source
SidebarLayout() { Text("Content"); Button("Action") }SidebarSection¶
A group of items (gap-0.5)
role vstack · defaults alignment: "stretch", spacing: 2
Source
SidebarSection() { Text("Content"); Button("Action") }StackedLayout¶
App shell: StackedLayout { Navbar { … }; VStack { page } } — navbar on top, page on an inset panel
role vstack · defaults alignment: "stretch", spacing: 0
Source
StackedLayout() { Text("Content"); Button("Action") }Stat¶
Stat(label:, value:, change:) — dashboard stat with a top rule (Catalyst demo)
role stat · arguments label, value
Source
Stat("Label", 60)Subheading¶
Subheading("Recent orders") — text-base/7 sm:text-sm/6 semibold
role text · arguments content · defaults style: "subheadline"
Source
Subheading("Content")Switch¶
Switch(isOn: true, color: .emerald) — h-5 w-8 track, any Tailwind colour
role toggle · arguments label
Source
Switch("Label")SwitchField¶
SwitchField("Allow embedding", isOn: true, description: "…") — label + description left, switch right
role toggle · arguments label
Source
SwitchField("Label")SwitchGroup¶
Stack of SwitchFields (space-y-3)
role vstack · defaults alignment: "stretch", spacing: 12
Source
SwitchGroup() { Text("Content"); Button("Action") }Table¶
Table(columns: […], rows: […]) or TableHeader/TableRow children · variant: .striped|.grid · dense: true · bleed: true
role table · variants striped, grid, bleed
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
| Name | Status |
|---|---|
| Ana Lima | Active |
| Ben Okafor | Away |
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("striped"); Text("striped").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("grid"); Text("grid").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("bleed"); Text("bleed").font(.caption).foregroundStyle(.secondary) }
}TableBody¶
Kept for source compatibility; put TableRow children directly in the Table
role group
Source
TableBody() { Text("Content"); Button("Action") }TableCell¶
TableCell("…") — a cell (or any view)
role text · arguments content
Source
TableCell("Content")TableHead¶
Kept for source compatibility; put TableHeader children directly in the Table
role group
Source
TableHead() { Text("Content"); Button("Action") }TableHeader¶
TableHeader("Amount", alignment: .trailing)
role tablecolumn · arguments title
Source
TableHeader("Title")Tabs¶
Tailwind Plus underline tabs: Tabs(selection: "Billing") { Tab("Account") { … } … } · variant: .pills
role tabs · defaults placement: "top" · variants underline, pills
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Tabs() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("underline"); Text("underline").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Tabs() { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("pills"); Text("pills").font(.caption).foregroundStyle(.secondary) }
}Text¶
Text("…") — body copy in zinc-500 (Catalyst Text); Markdown inline bold code
role text · arguments content
Source
Text("Content")TextLink¶
TextLink("docs") — underlined link
role link · arguments label
Source
TextLink("Label")Textarea¶
Textarea("…", rows: 4)
role textfield · arguments placeholder · defaults kind: "multiline"
Source
Textarea("Placeholder")TouchTarget¶
No-op wrapper kept for source compatibility
role group
Source
TouchTarget() { Text("Content"); Button("Action") }Core vocabulary in this style¶
Accordion¶
role accordion · arguments title
Source
Accordion("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)Card¶
role card · arguments title
Source
Card("Title") { Text("Content"); Button("Action") }Chart¶
kind: .bar|.line|.area|.pie|.donut|.scatter|.bubble|.radar|.heatmap|.funnel|.treemap|.gauge|.candlestick|.combo|.sparkline; values:/series:/labels:/points:/matrix:
role chart
Source
Chart(values: [3, 5, 2, 6, 4])CodeBlock¶
role code · arguments code · defaults lineNumbers: False
Source
CodeBlock("let total = items.count")CodeEditor¶
CodeEditor("…", language: "swift", lineNumbers:, highlight: [3], tabs: [..])
role code · arguments code
Source
CodeEditor("let total = items.count")Comment¶
author:, time:, avatar:
role message · arguments text · defaults variant: "comment"
Source
Comment("Text")ControlGroup¶
role toolbar · defaults variant: "group"
Source
ControlGroup() { Button("Save"); Button("Share") }DatePicker¶
selection: "2026-11-23"; .datePickerStyle(.graphical)
role datepicker · arguments label
Source
DatePicker("Label")DisclosureGroup¶
role accordion · arguments title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }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") }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]])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") } }Terminal¶
lines starting with "$ " are commands
role code · arguments code · defaults variant: "terminal"
Source
Terminal("let total = items.count")TextEditor¶
role textfield · arguments text · defaults kind: "multiline"
Source
TextEditor("Text")TextField¶
TextField("Placeholder", text: "value")
role textfield · arguments placeholder
Source
TextField("Placeholder")Timeline¶
role timeline
Source
Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }TimelineItem¶
title, time:, description:, systemImage:, status:
role timelineitem · arguments title
Source
TimelineItem("Title")ToolbarItem¶
ToolbarItem(placement: .topBarTrailing) { … }
role toolbaritem
Source
ToolbarItem() { Text("Content"); Button("Action") }ToolbarItemGroup¶
role toolbaritem
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }Tooltip¶
role tooltip · arguments text
Source
Tooltip("Text") { Text("Content"); Button("Action") }Tree¶
Tree { TreeItem("src") { TreeItem("main.swift") } }
role tree
Source
Tree() { TreeItem("Folder") { TreeItem("File") } }TreeItem¶
label, systemImage:, folder:, expanded:, selected:, detail:
role treeitem · arguments label
Source
TreeItem("Label")VStack¶
Vertical stack. spacing:, alignment: .leading|.center|.trailing
role vstack
Source
VStack() { Text("Content"); Button("Action") }VideoPlayer¶
poster image, progress: 0…1, time:, duration:, playing:
role media · arguments image
Source
VideoPlayer().frame(width: 160, height: 96)Whiteboard¶
role canvas · defaults grid: "dots"
Source
Whiteboard() { Text("Content"); Button("Action") }.frame(width: 160, height: 96)ZStack¶
Overlapping layers. alignment:
role zstack
Source
ZStack() { Text("Content"); Button("Action") }