Skip to content

Carbon

Imitates: IBM Carbon Design System v11 · @carbon/react, White theme (light) and g100 (dark); g10 / g90 zones via Theme 11 · Pack id: carbon · Selected by: pack="carbon", import Carbon, import CarbonReact · Default device: desktop (browser chrome)

148 own elements, plus 106 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

Accordion

Accordion { AccordionItem(title:, open: true) { … } }

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

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

AccordionItem

role accordion · arguments title

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

ActionableNotification

Inline notification with an action: ActionableNotification(…) actions: { Button("Undo", kind: "tertiary", size: "sm") }

role alert · arguments title · defaults closable: True, severity: "error"

Source
ActionableNotification("Title")

AreaChart

role chart · defaults kind: "area"

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

AspectRatio

role zstack

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

Breadcrumb(["Home", "Projects", "Atlas"]) or BreadcrumbItem children

role breadcrumb · arguments items

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

role link · arguments label, href

Label
Source
BreadcrumbItem("Label", "#")

BubbleChart

role chart · defaults kind: "bubble"

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

Button

Button("Create", kind: "secondary", size: "sm" | "md" | "lg" | "xl", renderIcon: "Add") — icon sits at the trailing edge

role button · arguments label · defaults variant: "primary" · variants primary, secondary, tertiary, ghost, danger, danger--tertiary, danger--ghost

Labelprimary
Labelsecondary
Labeltertiary
Labelghost
Labeldanger
Labeldanger--tertiary
Labeldanger--ghost
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("primary"); Text("primary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("secondary"); Text("secondary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("tertiary"); Text("tertiary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("ghost"); Text("ghost").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("danger"); Text("danger").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("danger--tertiary"); Text("danger--tertiary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Button("Label").variant("danger--ghost"); Text("danger--ghost").font(.caption).foregroundStyle(.secondary) }
}

ButtonSet

Buttons side by side with no gap (secondary + primary)

role toolbar · defaults variant: "set"

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

Checkbox

Checkbox("Email me", checked: true) · checked: "mixed"

role checkbox · arguments label

Label
Source
Checkbox("Label")

CheckboxGroup

CheckboxGroup(legendText:) { Checkbox … }

role radiogroup · arguments label

Label
Source
CheckboxGroup("Label")

ClickableTile

Whole tile is a link (arrow at the bottom right)

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

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

CodeSnippet

CodeSnippet("npm install @carbon/react", type: "single") — copy button at the end

role code · arguments code · defaults lineNumbers: False · variants single, multi, inline

let total = items.count
single
let total = items.count
multi
let total = items.count
inline
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { CodeSnippet("let total = items.count").variant("single"); Text("single").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { CodeSnippet("let total = items.count").variant("multi"); Text("multi").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { CodeSnippet("let total = items.count").variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
}

Column

Grid column: Column(lg: 8) spans 8 of 16 columns

role vstack · defaults alignment: "stretch"

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

ComboBox

role select · arguments label

Source
ComboBox("Label")

ComboButton

Primary action with a chevron menu

role menu · arguments label

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

ComboChart

role chart · defaults kind: "combo"

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

ComposedModal

ComposedModal(title:) { ModalBody { … } } actions: { Button(kind: "secondary"); Button }

role dialog · arguments title

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

Content

UI Shell main content area (32px padding)

role vstack · defaults alignment: "stretch"

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

ContentSwitcher

ContentSwitcher(selectedIndex: 0) { Switch("All"); Switch("Active") } · size: "sm" | "lg"

role segmented · arguments items

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

CopyButton

role button · arguments icon · defaults icon: "doc.on.doc", iconOnly: True, variant: "ghost"

Source
CopyButton()

DataTable

DataTable(columns: [..], rows: [[..]], selectable: true, selectedRows: [1], sortColumn: 0, size: "md") — or TableRow/TableExpandRow children

role table · variants zebra

NameStatus
Ana LimaActive
Ben OkaforAway
zebra
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { DataTable(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("zebra"); Text("zebra").font(.caption).foregroundStyle(.secondary) }
}

DataTableSkeleton

role skeleton · defaults lines: 6

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

DatePicker

DatePicker("Start date", value: "2026-11-23")

role datepicker · arguments label · defaults format: "numeric", placeholder: "mm/dd/yyyy"

mm/dd/yyyy
Source
DatePicker("Label")

DatePickerInput

role datepicker · arguments label · defaults format: "numeric", placeholder: "mm/dd/yyyy"

mm/dd/yyyy
Source
DatePickerInput("Label")

DefinitionTooltip

role tooltip · arguments text

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

DismissibleTag

role chip · arguments label · defaults color: "gray", removable: True

Label
Source
DismissibleTag("Label")

DonutChart

role chart · defaults kind: "donut"

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

Dropdown("Plan", items: ["Lite", "Standard"], selectedItem: "Standard", open: true)

role select · arguments label

Source
Dropdown("Label")

ExpandableSearch

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

Placeholder
Source
ExpandableSearch("Placeholder")

ExpandableTile

Chevron at the bottom right; include TileBelowTheFoldContent to show it expanded

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

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

FileUploader

FileUploader(labelTitle: "Upload files", labelDescription: "Max 500 kB") { FileUploaderButton("Add file"); FileUploaderItem("a.png", status: "complete") }

role card · arguments title

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

FileUploaderButton

role button · arguments label · defaults size: "sm", variant: "primary"

Label
Source
FileUploaderButton("Label")

FileUploaderDropContainer

Dashed drop area: FileUploaderDropContainer("Drag and drop files here or click to upload")

role dropzone · arguments label

Label
Source
FileUploaderDropContainer("Label")

FileUploaderItem

Uploaded file row: FileUploaderItem("report.pdf", status: "complete")

role chip · arguments label · defaults removable: True, variant: "edit" · variants edit, uploading, complete

Labeledit
Labeluploading
Labelcomplete
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { FileUploaderItem("Label").variant("edit"); Text("edit").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { FileUploaderItem("Label").variant("uploading"); Text("uploading").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { FileUploaderItem("Label").variant("complete"); Text("complete").font(.caption).foregroundStyle(.secondary) }
}

FilterableMultiSelect

role select · arguments label

Source
FilterableMultiSelect("Label")

FlexGrid

role vstack · defaults alignment: "stretch"

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

Form

Form { TextInput … } · fields stack with 24px gaps

role form

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

FormGroup

FormGroup(legendText: "Contact") { … }

role section · arguments title

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

FormItem

role vstack · defaults alignment: "stretch"

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

FormLabel

12px label-01 field label

role text · arguments content

Content
Source
FormLabel("Content")

GaugeChart

role chart · defaults kind: "gauge"

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

Grid

16-column CSS Grid: Grid { Column(lg: 4) { … } } · .narrow() / .condensed()

role grid · arguments columns · variants wide, narrow, condensed

ContentAction
wide
ContentAction
narrow
ContentAction
condensed
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Grid(["Name", "Status"]) { Text("Content"); Button("Action") }.variant("wide"); Text("wide").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Grid(["Name", "Status"]) { Text("Content"); Button("Action") }.variant("narrow"); Text("narrow").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Grid(["Name", "Status"]) { Text("Content"); Button("Action") }.variant("condensed"); Text("condensed").font(.caption).foregroundStyle(.secondary) }
}

GroupedBarChart

GroupedBarChart(series: [[..], [..]], seriesNames:, labels:)

role chart · defaults kind: "bar"

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

UI Shell header (48px, g100): Header("Cloud Console", prefix: "Acme", menu: true) { HeaderGlobalAction("Notification") } center: { HeaderNavigation { … } }

role appbar · arguments subtitle

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

HeaderGlobalAction

48×48 header icon button: HeaderGlobalAction("Notification").badge(true)

role button · arguments icon · defaults iconOnly: True

Source
HeaderGlobalAction("star")

HeaderGlobalBar

Right-hand group of HeaderGlobalAction icons

role toolbar

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

HeaderMenu

HeaderMenu("Manage", open: true) { HeaderMenuItem … }

role menu · arguments label

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

HeaderMenuButton

role button · arguments icon · defaults icon: "line.3.horizontal", iconOnly: True

Source
HeaderMenuButton()

HeaderMenuItem

Header link; .selected() / isCurrentPage: true marks the current page

role button · arguments label

Label
Source
HeaderMenuItem("Label")

HeaderName

Header product name (or use Header(prefix:))

role text · arguments content

Content
Source
HeaderName("Content")

HeaderNavigation

HeaderNavigation { HeaderMenuItem("Catalog").selected() … }

role toolbar

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

HeaderPanel

Right-hand panel under the header (e.g. Switcher)

role sidebar · arguments title · defaults variant: "panel"

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

Heading

Heading("Deployments") — heading-03 (20px); font: "heading-05" etc. for other productive headings

role text · arguments content · defaults font: "heading03"

Content
Source
Heading("Content")

HeatmapChart

role chart · defaults kind: "heatmap"

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

HelperText

12px helper text under a control

role text · arguments content

Content
Source
HelperText("Content")

HistogramChart

role chart · defaults kind: "histogram"

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

IconButton

IconButton("Edit", kind: "ghost", size: "sm")

role button · arguments icon · defaults iconOnly: True, variant: "primary" · variants primary, secondary, tertiary, ghost

primary
secondary
tertiary
ghost
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { IconButton("star").variant("primary"); Text("primary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { IconButton("star").variant("secondary"); Text("secondary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { IconButton("star").variant("tertiary"); Text("tertiary").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { IconButton("star").variant("ghost"); Text("ghost").font(.caption).foregroundStyle(.secondary) }
}

InlineLoading

role progress · arguments label · defaults kind: "circular", size: "small"

Label
Source
InlineLoading("Label")

InlineNotification

InlineNotification(title: "Error", subtitle: "…", kind: "error" | "success" | "warning" | "info", lowContrast: true)

role alert · arguments title · defaults closable: True, severity: "error" · variants lowContrast

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

Layer

Raises nested components one layer (layer-02 / field-02)

role vstack · defaults alignment: "stretch"

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

LineChart

role chart · defaults kind: "line"

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

Link("Learn more", icon: "ArrowRight") · size: "sm" | "lg"

role link · arguments label, href

Label
Source
Link("Label", "#")

Loading

Spinner; size: "small"

role progress · defaults kind: "circular"

Source
Loading()

MenuButton("Actions", kind: "primary", open: true) { MenuItem … }

role menu · arguments label

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

MeterChart

Carbon Charts meter: a labelled proportion bar

role progress · arguments label

Label
Source
MeterChart("Label")

Modal("Delete project?", buttons: ["Cancel", "Delete"], destructive: "Delete", closable: true) { body }

role dialog · arguments title

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

ModalBody

role vstack · defaults alignment: "stretch"

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

MultiSelect

MultiSelect("Tags", selectedItems: ["api", "web"]) — selected values show as tags

role select · arguments label

Source
MultiSelect("Label")

NumberInput

NumberInput("Replicas", value: 3) — field with − / + buttons

role stepper · arguments label

Label
Source
NumberInput("Label")

OperationalTag

role chip · arguments label · defaults color: "gray"

Label
Source
OperationalTag("Label")

OrderedList

OrderedList { ListItem("…") } — numbered

role list

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

OverflowMenu

OverflowMenu(open: true) { OverflowMenuItem("Edit"); OverflowMenuItem("Delete", isDelete: true) }

role menu · defaults icon: "ellipsis.vertical"

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

OverflowMenuItem

role menuitem · arguments label

Source
OverflowMenuItem("Label")

Pagination

Carbon's bar: Pagination("31–40 of 97 items", page: 4, count: 10, pageSize: 10)

role pagination · arguments summary · defaults rowsPerPage: 10

Source
Pagination("Summary")

PaginationNav

Numbered page links: PaginationNav(page: 3, totalItems: 12)

role pagination

Source
PaginationNav()

PasswordInput

role textfield · arguments label · defaults kind: "password", trailingIcon: "eye"

Source
PasswordInput("Label")

PieChart

role chart · defaults kind: "pie"

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

ProgressBar

ProgressBar("Uploading", value: 60, showValue: true) · size: "small"

role progress · arguments label

Label
Source
ProgressBar("Label")

ProgressIndicator

ProgressIndicator(currentIndex: 1) { ProgressStep("Details") … } · errors: [2]

role steps · arguments steps

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

ProgressStep

Step of a ProgressIndicator: ProgressStep("Details", secondaryLabel: "Optional")

role text · arguments label

Source
ProgressStep("Label")

RadarChart

role chart · defaults kind: "radar"

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

RadioButton

role radio · arguments label

Label
Source
RadioButton("Label")

RadioButtonGroup

RadioButtonGroup(legendText: "Plan", options: [..], valueSelected: "Lite", orientation: .vertical)

role radiogroup · arguments label

Label
Source
RadioButtonGroup("Label")

RadioTile

Radio at the top right; .selected()

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

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

ScatterChart

role chart · defaults kind: "scatter"

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

Search("Search", size: "lg") · value: shows the clear button

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

Placeholder
Source
Search("Placeholder")

Select

Select("Region", value: "US South") { SelectItem("US South") … }

role select · arguments label

Source
Select("Label")

SelectItem

Option of a Select: SelectItem("US South")

role text · arguments text

Text
Source
SelectItem("Text")

SelectableTag

SelectableTag("Python").selected()

role chip · arguments label

Label
Source
SelectableTag("Label")

SelectableTile

Checkbox at the top right; .selected() outlines it

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

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

SideNav

SideNav { SideNavLink("Dashboard", icon: "Dashboard").selected(); SideNavMenu("Manage") { SideNavMenuItem … } }

role sidebar · arguments title · variants fixed, rail

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

SideNavDivider

role divider

Source
SideNavDivider()

SideNavItems

role group

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

role navitem · arguments label

Label
Source
SideNavLink("Label")

SideNavMenu

Expandable SideNav category; expands when a child is selected or expanded: true

role navitem · arguments label

Label
Source
SideNavMenu("Label")

SideNavMenuItem

role navitem · arguments label

Label
Source
SideNavMenuItem("Label")

SimpleBarChart

Carbon Charts: SimpleBarChart(values: [..], labels: [..])

role chart · defaults kind: "bar"

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

SkeletonPlaceholder

role skeleton · defaults lines: 0, shape: "rectangle"

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

SkeletonText

role skeleton · defaults lines: 3

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

Slider

Slider(labelText: "Budget", value: 40, min: 0, max: 100, minLabel: "0", maxLabel: "100")

role slider · defaults showValue: True

0
Source
Slider()

Stack

Stack(gap: 16) · orientation: .horizontal for a row

role vstack · defaults alignment: "stretch"

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

StackedAreaChart

role chart · defaults kind: "area", stacked: True

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

StackedBarChart

role chart · defaults kind: "bar", stacked: True

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

StructuredList

StructuredList(columns: [..]) { StructuredListRow { StructuredListCell("…") } } · selection: true for radio rows

role table · arguments columns

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

StructuredListCell

Cell of a StructuredListRow; head: true for a header cell

role text · arguments content

Content
Source
StructuredListCell("Content")

StructuredListRow

role tablerow

Source
StructuredListRow()

StructuredListWrapper

role table · arguments columns

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

Switch

Segment of a ContentSwitcher: Switch("Active")

role text · arguments text

Text
Source
Switch("Text")

Switcher

role group

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

SwitcherDivider

role divider

Source
SwitcherDivider()

SwitcherItem

role navitem · arguments label

Label
Source
SwitcherItem("Label")

Tab

role tab · arguments label

Source
Tab("Label")

TabList

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

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

TabPanel

role vstack · defaults alignment: "stretch"

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

Table

role table

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

TableBatchAction

role button · arguments label

Label
Source
TableBatchAction("Label")

TableBatchActions

Blue batch bar shown when rows are selected: TableBatchActions("3 items selected") { TableBatchAction("Delete", renderIcon: "TrashCan"); Button("Cancel") }

role toolbar · arguments title

Source
TableBatchActions("Title") { Button("Save"); Button("Share") }

TableCell

Cell inside TableRow / StructuredListRow

role text · arguments content

Content
Source
TableCell("Content")

TableContainer

TableContainer(title: "Deployments", description: "…") { TableToolbar { … }; DataTable(…) }

role card · arguments title

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

TableExpandRow

Row with an expand chevron; follow it with TableExpandedRow { … } to show it expanded

role tablerow · defaults status: "collapsed"

Source
TableExpandRow()

TableExpandedRow

Full-width detail row under a TableExpandRow

role tablerow · defaults status: "detail"

Source
TableExpandedRow()

TableHeader

role tablecolumn · arguments title

Source
TableHeader("Title")

TableRow

role tablerow

Source
TableRow()

TableToolbar

48px toolbar above a DataTable: search, icon actions, primary button

role toolbar

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

TableToolbarAction

role menuitem · arguments label

Source
TableToolbarAction("Label")

TableToolbarContent

role hstack · defaults spacing: 0

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

TableToolbarMenu

role menu · defaults icon: "gear"

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

TableToolbarSearch

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

Search
Source
TableToolbarSearch()

Tabs

Tabs(selectedIndex: 0) { Tab("Overview") { panel } … } · .contained()

role tabs · arguments items · defaults placement: "top" · variants line, contained

OneTwo
First tab
line
OneTwo
First tab
contained
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("line"); Text("line").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Tabs(["One", "Two", "Three"]) { Text("First tab").tabItem { Text("One") }; Text("Second tab").tabItem { Text("Two") } }.variant("contained"); Text("contained").font(.caption).foregroundStyle(.secondary) }
}

Tag

Tag("Running", type: "green") — red, magenta, purple, blue, cyan, teal, green, gray, cool-gray, warm-gray, high-contrast, outline · size: "sm"

role chip · arguments label · defaults color: "gray"

Label
Source
Tag("Label")

TextArea

TextArea("Notes", value:, rows: 4)

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

Source
TextArea("Label")

TextInput

TextInput("Email", placeholder:, helperText:, invalidText: "…", size: "sm" | "md" | "lg")

role textfield · arguments label

Source
TextInput("Label")

Theme

Zoned theme: Theme("g100") { … } renders its content in that theme

role vstack · arguments variant · defaults alignment: "stretch" · variants white, g10, g90, g100

ContentAction
white
ContentAction
g10
ContentAction
g90
ContentAction
g100
Source
HStack(alignment: .top, spacing: 16) {
  VStack(alignment: .leading, spacing: 4) { Theme() { Text("Content"); Button("Action") }.variant("white"); Text("white").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Theme() { Text("Content"); Button("Action") }.variant("g10"); Text("g10").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Theme() { Text("Content"); Button("Action") }.variant("g90"); Text("g90").font(.caption).foregroundStyle(.secondary) }
  VStack(alignment: .leading, spacing: 4) { Theme() { Text("Content"); Button("Action") }.variant("g100"); Text("g100").font(.caption).foregroundStyle(.secondary) }
}

Tile

Tile(title:) { … } — layer-01 surface, 16px padding, square

role card · arguments title

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

TileAboveTheFoldContent

role vstack · defaults alignment: "stretch"

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

TileBelowTheFoldContent

Present = ExpandableTile shown expanded

role vstack · defaults alignment: "stretch"

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

TileGroup

Group of RadioTiles

role vstack · defaults alignment: "stretch"

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

TimePicker

role datepicker · arguments label · defaults kind: "time", placeholder: "hh:mm"

hh:mm
Source
TimePicker("Label")

ToastNotification

ToastNotification(title:, subtitle:, kind:) { Text("caption") } — top-right; inline: true to place it

role toast · arguments title · defaults closable: True, position: "topTrailing", severity: "error"

Title
Source
ToastNotification("Title")

Toggle

Toggle("Notifications", toggled: true, size: "sm")

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

LabelOff
Source
Toggle("Label")

Toggletip

role tooltip · arguments text

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

Tooltip

Tooltip("Copy") { IconButton … } · align: .bottom

role tooltip · arguments text

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

TreeNode

role treeitem · arguments label

Label
Source
TreeNode("Label")

TreeView

role tree · arguments label

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

TreemapChart

role chart · defaults kind: "treemap"

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

UnorderedList

UnorderedList { ListItem("…") } — en-dash bullets

role list

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

Core vocabulary in this style

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

AsyncImage

role image · arguments url

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

Avatar

role avatar · arguments name

AL
Source
Avatar("Ana Lima")

Badge

role badge · arguments text

Text
Source
Badge("Text")

role alert · arguments title

Source
Banner("Title")

BarChart

role chart · defaults kind: "bar"

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

Board

Kanban board of BoardColumn children

role board

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

BoardColumn

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

role boardcolumn · arguments title

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

Calendar

role calendar

November 2026
SuMoTuWeThFrSa12345678910111213141516171819202122232425262728293012345
Source
Calendar()

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

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

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

Dialog

role dialog · arguments title

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

DisclosureGroup

role accordion · arguments title

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

Divider

role divider

Source
Divider()

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

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)

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

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

Label

Label("Inbox", systemImage: "tray")

role label · arguments title

Title
Source
Label("Title")

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

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

role menuitem · arguments label

Source
MenuItem("Label")

MessageBubble

MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])

role message · arguments text

Text
Source
MessageBubble("Text")

role navitem · arguments label

Label
Source
NavItem("Label")

role listitem · arguments title · defaults chevron: True

Title
Source
NavigationLink("Title")

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

role split

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

Content's .navigationTitle / .toolbar form the bar

role navstack

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

role navstack

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

Picker

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

role select · arguments label

Source
Picker("Label")

Placeholder

A labelled box for maps, charts, media

role placeholder · arguments label

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

Pointer

Pointer(.arrow|.hand|.ibeam|.grab|.crosshair|.touch); place with .position

role pointer · arguments kind

Source
Pointer(.arrow)

ProgressView

value: 0…1 (or total:); none = indeterminate

role progress · arguments label

Label
Source
ProgressView("Label")

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

Schedule

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

role schedule

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

ScrollView

role scroll · arguments axes

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

SearchField

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

Placeholder
Source
SearchField("Placeholder")

Section

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

role section · arguments title

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

SecureField

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

Placeholder
Source
SecureField("Placeholder")

SegmentedControl

role segmented · arguments items

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

SelectionRect

a drag-selection rectangle; size with .frame, place with .position

role marquee

Source
SelectionRect()

Sheet

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

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

role sidebar · arguments title

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

Skeleton

lines:, avatar:, image:, shape: .circle|.rectangle|.text

role skeleton

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

Spacer

role spacer

Source
Spacer()

Sparkline

role chart · arguments values · defaults kind: "sparkline"

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

Spreadsheet

rows: [[…]], selection: "B2:C4", active:, formula:, sheets: [..], highlight: ["B3": .yellow]

role spreadsheet

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

Stat

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

role stat · arguments label, value

Label
60
Source
Stat("Label", 60)

Stepper

role stepper · arguments label

Label
Source
Stepper("Label")

Steps

role steps · arguments steps

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

StickyNote

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

role stickynote · arguments text

Text
Source
StickyNote("Text")

TabView

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

role tabs · defaults placement: "bottom"

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

TableColumn

role tablecolumn · arguments title

Source
TableColumn("Title")

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

Toast

role toast · arguments message

Message
Source
Toast("Message")

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

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