Ant Design¶
Imitates: Ant Design (antd) + ProComponents · React, default token theme v5 · Pack id: antd · Selected by: pack="antd", import Antd, import AntDesign, import ProComponents · Default device: desktop (browser chrome)
150 own elements, plus 101 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¶
Alert(message: "Saved", description: "…", type: "success"|"info"|"warning"|"error", showIcon: true, closable: true, action: { … })
role alert · arguments title · defaults showIcon: False · variants default, banner
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Alert("Title").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Alert("Title").variant("banner"); Text("banner").font(.caption).foregroundStyle(.secondary) }
}Anchor¶
Anchor { AnchorLink("Basic") … } — in-page nav with the ink rail
role list
Source
Anchor() { Text("First item"); Text("Second item") }App¶
App wrapper (renders its content)
role group
Source
App() { Text("Content"); Button("Action") }AutoComplete¶
AutoComplete("Search…", value:, options: [..], open: true)
role select · arguments placeholder
Source
AutoComplete("Placeholder")Avatar¶
Avatar("Ana Lima", src: "…", icon: "UserOutlined", shape: "square", size: "small"|"large")
role avatar · arguments name · variants circle, square
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Avatar("Ana Lima").variant("circle"); Text("circle").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Avatar("Ana Lima").variant("square"); Text("square").font(.caption).foregroundStyle(.secondary) }
}AvatarGroup¶
Avatar.Group { Avatar … } — overlapped avatars with white rings
role hstack · defaults spacing: 0
Source
AvatarGroup() { Text("Content"); Button("Action") }Badge¶
Badge(count: 5) { Avatar(…) } · Badge(dot: true) · Badge(status: "success", text: "Running") · overflowCount: 99
role badge · arguments count
Source
Badge(3)BadgeRibbon¶
Badge.Ribbon(text: "Recommended", color: "volcano") { Card(…) } — corner ribbon over its child
role badge · arguments text · defaults variant: "ribbon"
Source
BadgeRibbon("Text")Breadcrumb¶
Breadcrumb(["Home", "Orders", "Detail"]) — "/" separators
role breadcrumb · arguments items
Source
Breadcrumb(["One", "Two", "Three"])Button¶
Button("Save", type: "primary", icon: "SaveOutlined", size: "small"|"large", shape: "circle"|"round") · .danger() · v5.21 color:/variant: ("solid", "outlined", "dashed", "filled", "text", "link")
role button · arguments label · defaults variant: "default" · variants primary, default, dashed, text, link, solid, outlined, filled
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("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("dashed"); Text("dashed").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("link"); Text("link").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Button("Label").variant("solid"); Text("solid").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("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
}ButtonGroup¶
Joined buttons (Space.Compact of Buttons)
role toolbar · defaults variant: "group"
Source
ButtonGroup() { Button("Save"); Button("Share") }Calendar¶
Calendar(value: "2026-11-24", fullscreen: false)
role calendar
Source
Calendar()Card¶
Card(title: "Orders", extra: { Link("More") }, size: "small", cover: "…", hoverable:) { … } actions: { Icon(…) … }
role card · arguments title · variants outlined, borderless
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Card("Title") { Text("Content"); Button("Action") }.variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Card("Title") { Text("Content"); Button("Action") }.variant("borderless"); Text("borderless").font(.caption).foregroundStyle(.secondary) }
}CardGrid¶
Card.Grid — a hoverable cell of a grid card
role vstack
Source
CardGrid() { Text("Content"); Button("Action") }CardMeta¶
Card.Meta(title:, description:, avatar:)
role listitem · arguments title
Source
CardMeta("Title")Carousel¶
Carousel(image: "…") — one slide with dots
role media · arguments image
Source
Carousel().frame(width: 160, height: 96)Cascader¶
Cascader(value: "Asia / Japan / Tokyo", options: ["Asia", "Europe"], open: true)
role select · arguments placeholder
Source
Cascader("Placeholder")CheckCard¶
CheckCard(title:, description:, avatar:, checked: true)
role card · arguments title · defaults variant: "check"
Source
CheckCard("Title") { Text("Content"); Button("Action") }CheckableTag¶
Tag.CheckableTag("Movies", checked: true)
role chip · arguments label · defaults variant: "checkable"
Source
CheckableTag("Label")Checkbox¶
Checkbox("Remember me", checked: true) · checked: "indeterminate"
role checkbox · arguments label
Source
Checkbox("Label")CheckboxGroup¶
Checkbox.Group { Checkbox … } — a row of checkboxes (spacing 8)
role hstack · defaults spacing: 8
Source
CheckboxGroup() { Text("Content"); Button("Action") }Col¶
Col(span: 6) — spans 1…24 columns of its Row
role vstack · defaults alignment: "stretch"
Source
Col() { Text("Content"); Button("Action") }Collapse¶
Collapse { CollapsePanel("Header", expanded: true) { … } … } · bordered: false · ghost: true
role vstack · defaults alignment: "stretch", spacing: 0 · variants default, borderless, ghost
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Collapse() { Text("Content"); Button("Action") }.variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Collapse() { Text("Content"); Button("Action") }.variant("borderless"); Text("borderless").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Collapse() { Text("Content"); Button("Action") }.variant("ghost"); Text("ghost").font(.caption).foregroundStyle(.secondary) }
}CollapsePanel¶
Collapse panel; extra: { … } on the right
role accordion · arguments title
Source
CollapsePanel("Title") { Text("Content"); Button("Action") }ColorPicker¶
ColorPicker(colors: ["#1677ff", …], selection: 0, label: "#1677FF")
role swatches
Source
ColorPicker()Column¶
Table column header (alignment: .trailing)
role tablecolumn · arguments title
Source
Column("Title")ConfigProvider¶
ConfigProvider wrapper (renders its content)
role group
Source
ConfigProvider() { Text("Content"); Button("Action") }Content¶
Layout.Content — the padded page body
role vstack · defaults alignment: "stretch"
Source
Content() { Text("Content"); Button("Action") }DatePicker¶
DatePicker(value: "2026-11-24", placeholder: "Select date", open: true)
role datepicker · arguments placeholder · defaults format: "iso"
Source
DatePicker("Placeholder")Descriptions¶
Descriptions(title: "User Info", column: 3, bordered: true, size: "small", extra: { … }) { DescriptionsItem("Name", "Ana") … }
role section · arguments title
Source
Descriptions("Title") { Text("First item"); Text("Second item") }DescriptionsItem¶
DescriptionsItem("Status") { Badge(status:, text:) } · span: 2
role labeled · arguments label, value
Source
DescriptionsItem("Label", "Value") { Text("Content"); Button("Action") }DirectoryTree¶
role tree · defaults variant: "directory"
Source
DirectoryTree() { TreeItem("Folder") { TreeItem("File") } }Divider¶
Divider() · Divider(label: "Text", orientation: "left") · type: "vertical" · dashed: true
role divider · variants solid, dashed, dotted
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Divider().variant("solid"); Text("solid").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Divider().variant("dashed"); Text("dashed").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Divider().variant("dotted"); Text("dotted").font(.caption).foregroundStyle(.secondary) }
}Dragger¶
Alias of UploadDragger
role dropzone · arguments label · defaults icon: "InboxOutlined"
Source
Dragger("Label")Drawer¶
Drawer(title: "Order #1024", placement: .right, width: 420) { … } footer: { Button … }
role dialog · arguments title · defaults closable: True, variant: "drawer"
Source
Drawer("Title") { Text("Content"); Button("Action") }Dropdown¶
Dropdown("Actions", open: true) { DropdownItem("Edit", icon:); MenuDivider(); DropdownItem("Delete", danger: true) }
role menu · arguments label
Source
Dropdown("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownButton¶
Dropdown.Button — a button with a separate caret
role menu · arguments label · defaults variant: "default"
Source
DropdownButton("Label") { Button("Open"); Button("Save"); Divider(); Button("Close") }DropdownItem¶
Item of a Dropdown menu; danger: true, extra: "⌘E"
role menuitem · arguments label
Source
DropdownItem("Label")Empty¶
Empty("No orders yet") { Button("Create", type: "primary") } · image: "simple"
role emptystate · arguments description · defaults description: "No data", icon: "tray" · variants default, simple
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Empty().variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Empty().variant("simple"); Text("simple").font(.caption).foregroundStyle(.secondary) }
}Flex¶
Flex(gap: 16, vertical: true, justify:, align:, wrap: true) { … }
role hstack
Source
Flex() { Text("Content"); Button("Action") }FloatButton¶
FloatButton(icon: "QuestionCircleOutlined", type: "primary", description: "HELP") — floats bottom-right
role fab · arguments icon · defaults variant: "default" · variants default, primary
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { FloatButton("star").variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { FloatButton("star").variant("primary"); Text("primary").font(.caption).foregroundStyle(.secondary) }
}Footer¶
Layout.Footer — centered secondary text
role hstack
Source
Footer() { Text("Content"); Button("Action") }FooterToolbar¶
FooterToolbar { Button … } — the fixed bottom action bar
role toolbar · defaults variant: "footer"
Source
FooterToolbar() { Button("Save"); Button("Share") }Form¶
Form(layout: "horizontal"|"vertical"|"inline") { FormItem(…) { … } · Input(label:) … } — horizontal puts right-aligned labels with a colon left
role form · defaults variant: "horizontal" · variants horizontal, vertical, inline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("horizontal"); Text("horizontal").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("vertical"); Text("vertical").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Form() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
}FormItem¶
FormItem("Notifications", required: true, help: "…") { Switch() } — label + any control
role labeled · arguments label
Source
FormItem("Label") { Text("Content"); Button("Action") }GridContent¶
role vstack · defaults alignment: "stretch", spacing: 24
Source
GridContent() { Text("Content"); Button("Action") }Header¶
Layout.Header — 64 px bar, #001529 (theme: "light" for white); children go to the right
role appbar · arguments title · defaults variant: "dark" · variants dark, light
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Header("Title") { Text("Content"); Button("Action") }.variant("dark"); Text("dark").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Header("Title") { Text("Content"); Button("Action") }.variant("light"); Text("light").font(.caption).foregroundStyle(.secondary) }
}Icon¶
Ant icon by component name: Icon("SettingOutlined")
role icon · arguments name
Source
Icon("star")Image¶
Image(src: "…", width: …)
role image · arguments src
Source
Image().frame(width: 160, height: 96)Input¶
Input("Email", label: "Email", value:, prefix:, suffix:, addonBefore: "https://", allowClear: true, status: "error", size:)
role textfield · arguments placeholder · variants outlined, filled, borderless, underlined
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Input("Placeholder").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Input("Placeholder").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Input("Placeholder").variant("borderless"); Text("borderless").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Input("Placeholder").variant("underlined"); Text("underlined").font(.caption).foregroundStyle(.secondary) }
}InputNumber¶
InputNumber(value: 3, min: 1, max: 10, addonAfter: "kg")
role textfield · arguments placeholder · defaults kind: "number", trailingIcon: "chevron.up.down"
Source
InputNumber("Placeholder")InputOTP¶
Input.OTP(items: ["4", "8", "1", "", "", ""])
role segmented · arguments items · defaults variant: "otp"
Source
InputOTP(["One", "Two", "Three"])InputPassword¶
Input.Password with the eye toggle
role textfield · arguments placeholder · defaults kind: "password", reveal: True
Source
InputPassword("Placeholder")InputSearch¶
Input.Search("Search orders", enterButton: true)
role textfield · arguments placeholder · defaults kind: "search"
Source
InputSearch("Placeholder")Layout¶
Layout { Header; Layout { Sider; Content }; Footer } — colorBgLayout background; hasSider: true for a row
role vstack · defaults alignment: "stretch", spacing: 0
Source
Layout() { Text("Content"); Button("Action") }LayoutHeader¶
Alias of Header
role appbar · arguments title · defaults variant: "dark"
Source
LayoutHeader("Title") { Text("Content"); Button("Action") }LightFilter¶
LightFilter { Select(…, variant: "borderless") … } — compact inline filters
role hstack · defaults spacing: 8
Source
LightFilter() { Text("Content"); Button("Action") }List¶
List(header: "Activity", bordered: true, size: "small") { ListItem(…) } · itemLayout: "vertical"
role list · variants default, bordered, split
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { List() { Text("First item"); Text("Second item") }.variant("split"); Text("split").font(.caption).foregroundStyle(.secondary) }
}ListItem¶
List.Item with Meta: ListItem("Title", description: "…", avatar: "Ana") actions: { Link("edit") }
role listitem · arguments title
Source
ListItem("Title")Mentions¶
Mentions — a TextArea that suggests @names
role textfield · arguments placeholder · defaults kind: "multiline"
Source
Mentions("Placeholder")Menu¶
Menu(mode: "inline"|"vertical"|"horizontal", theme: "dark", selection: "Orders") { MenuItem(…); SubMenu(…) { … } }
role sidebar · defaults variant: "light" · variants light, dark
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Menu() { Text("Content"); Button("Action") }.variant("light"); Text("light").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Menu() { Text("Content"); Button("Action") }.variant("dark"); Text("dark").font(.caption).foregroundStyle(.secondary) }
}MenuItem¶
MenuItem("Orders", icon: "ShoppingCartOutlined").selected() · danger via .badge / DropdownItem
role navitem · arguments label
Source
MenuItem("Label")MenuItemGroup¶
Menu.ItemGroup — grey caption above a group of items
role section · arguments title
Source
MenuItemGroup("Title") { Text("First item"); Text("Second item") }Message¶
message.success(…): Message("Saved successfully", type: "success") — a small card at the top centre
role toast · arguments message · defaults icon: "InfoCircleFilled", position: "top", variant: "info" · variants info, success, error, warning, loading
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Message("Message").variant("info"); Text("info").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Message("Message").variant("success"); Text("success").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Message("Message").variant("error"); Text("error").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Message("Message").variant("warning"); Text("warning").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Message("Message").variant("loading"); Text("loading").font(.caption).foregroundStyle(.secondary) }
}Modal¶
Modal(title: "Basic Modal", open: true) { … } footer: { Button("Cancel"); Button("OK", type: "primary") } · buttons: ["Cancel", "OK"]
role dialog · arguments title · defaults closable: True
Source
Modal("Title") { Text("Content"); Button("Action") }ModalConfirm¶
Modal.confirm(title:, content:, buttons: ["Cancel", "Delete"], destructive: "Delete") — icon left, buttons bottom-right
role dialog · arguments title · defaults buttons: ["Cancel", "OK"], icon: "ExclamationCircleFilled", variant: "confirm"
Source
ModalConfirm("Title") { Text("Content"); Button("Action") }Notification¶
notification.open: Notification(message: "New order", description: "…", type: "success", icon:) — top-right card
role toast · arguments message · defaults closable: True, position: "topRight", variant: "notification"
Source
Notification("Message")PageContainer¶
PageContainer(title: "Basic list", subtitle:) header: { Breadcrumb([..]) } extra: { Button … } { content }
role card · arguments title
Source
PageContainer("Title") { Text("Content"); Button("Action") }PageHeader¶
PageHeader(title:, subTitle:, onBack: true) extra: { … }
role card · arguments title · defaults variant: "header"
Source
PageHeader("Title") { Text("Content"); Button("Action") }Pagination¶
Pagination(total: 85, current: 2, showTotal: "Total 85 items", pageSize: 10, size: "small") — count is pages
role pagination · variants default, simple, mini
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Pagination().variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Pagination().variant("simple"); Text("simple").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Pagination().variant("mini"); Text("mini").font(.caption).foregroundStyle(.secondary) }
}Panel¶
role accordion · arguments title
Source
Panel("Title") { Text("Content"); Button("Action") }Paragraph¶
Typography.Paragraph — body text with 1em bottom margin; type: "secondary"
role text · arguments content
Source
Paragraph("Content")Password¶
role textfield · arguments placeholder · defaults kind: "password", reveal: True
Source
Password("Placeholder")Popconfirm¶
Popconfirm(title: "Delete the task", description: "Are you sure?") { Button(…) } actions: { … }
role tooltip · arguments title
Source
Popconfirm("Title") { Text("Content"); Button("Action") }Popover¶
Popover(title: "Title", content: "…") { Button(…) } — white card bubble
role tooltip · arguments title
Source
Popover("Title") { Text("Content"); Button("Action") }ProCard¶
ProCard(title: "Trend", extra: { … }, bordered: true, headerBordered: true, split: "vertical") { … }
role card · arguments title · variants default, inner
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ProCard("Title") { Text("Content"); Button("Action") }.variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProCard("Title") { Text("Content"); Button("Action") }.variant("inner"); Text("inner").font(.caption).foregroundStyle(.secondary) }
}ProDescriptions¶
ProDescriptions(title:, column: 2) { DescriptionsItem … }
role section · arguments title
Source
ProDescriptions("Title") { Text("First item"); Text("Second item") }ProForm¶
ProForm(layout: "vertical") { ProFormText(…) … } actions: { Button("Submit", type: "primary") }
role form · defaults variant: "vertical" · variants horizontal, vertical, inline
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { ProForm() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("horizontal"); Text("horizontal").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProForm() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("vertical"); Text("vertical").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProForm() { TextField("Name"); Toggle("Notifications", isOn: true) }.variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
}ProFormDatePicker¶
role datepicker · arguments label · defaults format: "iso"
Source
ProFormDatePicker("Label")ProFormDateRangePicker¶
role datepicker · arguments label · defaults format: "iso", kind: "range"
Source
ProFormDateRangePicker("Label")ProFormDigit¶
role textfield · arguments label · defaults kind: "number", trailingIcon: "chevron.up.down"
Source
ProFormDigit("Label")ProFormPassword¶
role textfield · arguments label · defaults kind: "password", reveal: True
Source
ProFormPassword("Label")ProFormRadioGroup¶
role radiogroup · arguments label · defaults orientation: "horizontal"
Source
ProFormRadioGroup("Label") { Radio("First", selected: true); Radio("Second") }ProFormSelect¶
ProFormSelect("Status", options: [..], value:)
role select · arguments label
Source
ProFormSelect("Label")ProFormText¶
ProFormText("Name", placeholder:, required: true, width: "md")
role textfield · arguments label
Source
ProFormText("Label")ProFormTextArea¶
role textfield · arguments label · defaults kind: "multiline"
Source
ProFormTextArea("Label")ProFormUploadDragger¶
role dropzone · arguments label · defaults icon: "InboxOutlined"
Source
ProFormUploadDragger("Label")ProHeader¶
ProLayout global header (56 px): ProHeader(title:, search:, notifications: 3, avatar: "Serati Ma") { actions }
role appbar · arguments title · defaults variant: "pro"
Source
ProHeader("Title") { Text("Content"); Button("Action") }ProLayout¶
ProLayout(layout: "side"|"mix"|"top") { ProSider(…) { MenuItem … }; VStack { ProHeader(…); PageContainer(…) { … } } }
role hstack · defaults alignment: "stretch", spacing: 0
Source
ProLayout() { Text("Content"); Button("Action") }ProList¶
ProList(headerTitle: "Members") { ListItem … }
role list
Source
ProList() { Text("First item"); Text("Second item") }ProSider¶
ProLayout side menu with logo + title header: ProSider(title: "Ant Design Pro", logo: …)
role sidebar · arguments title · defaults variant: "light"
Source
ProSider("Title") { Text("Content"); Button("Action") }ProTable¶
ProTable(headerTitle: "Orders", columns:, rows:, rowSelection: true) toolbar: { Button(…) } footer: { Pagination(…) }
role table · variants default, bordered
| 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) { ProTable(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { ProTable(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
}Progress¶
Progress(percent: 30, type: "circular", status: "exception"|"success"|"active", size: "small", strokeColor:, showInfo: false)
role progress · arguments percent · defaults showValue: True · variants line, circle, dashboard
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Progress(60).variant("line"); Text("line").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Progress(60).variant("circle"); Text("circle").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Progress(60).variant("dashboard"); Text("dashboard").font(.caption).foregroundStyle(.secondary) }
}QRCode¶
QRCode(value:) — a QR placeholder
role placeholder · arguments label · defaults icon: "square.grid.3x3"
Source
QRCode("Label").frame(width: 160, height: 96)QueryFilter¶
QueryFilter { ProFormText(…) … } actions: { Button("Reset"); Button("Query", type: "primary") } — the 3-column search form above a ProTable
role form · defaults variant: "query"
Source
QueryFilter() { TextField("Name"); Toggle("Notifications", isOn: true) }RadioGroup¶
Radio.Group(options: ["Daily", "Weekly"], value: "Weekly", optionType: "button", buttonStyle: "solid")
role radiogroup · arguments label · defaults orientation: "horizontal" · variants default, button, solid
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { RadioGroup("Label") { Radio("First", selected: true); Radio("Second") }.variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { RadioGroup("Label") { Radio("First", selected: true); Radio("Second") }.variant("button"); Text("button").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { RadioGroup("Label") { Radio("First", selected: true); Radio("Second") }.variant("solid"); Text("solid").font(.caption).foregroundStyle(.secondary) }
}RangePicker¶
DatePicker.RangePicker(value: "2026-11-01 → 2026-11-30")
role datepicker · arguments placeholder · defaults format: "iso", kind: "range"
Source
RangePicker("Placeholder")Result¶
Result(status: "success", title: "Successfully Purchased!", subTitle: "Order 2017…") { Button("Go Console", type: "primary") }
role emptystate · arguments title · defaults icon: "checkmark.circle", kind: "success" · variants success, error, info, warning, 404, 403, 500
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("success"); Text("success").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("error"); Text("error").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("info"); Text("info").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("warning"); Text("warning").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("404"); Text("404").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("403"); Text("403").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Result("Title").variant("500"); Text("500").font(.caption).foregroundStyle(.secondary) }
}Row¶
Row(gutter: 16) { Col(span: 8) { … } … } — the 24-column grid
role grid · defaults columns: 24
Source
Row() { Text("Content"); Button("Action") }Search¶
role textfield · arguments placeholder · defaults kind: "search"
Source
Search("Placeholder")Segmented¶
Segmented(options: ["Daily", "Weekly", "Monthly"], value: "Weekly", block: true, size:)
role segmented · arguments options
Source
Segmented(["One", "Two"])Select¶
Select("Status", value: "Active", options: [..], open: true) · mode: "multiple" with value: [..] renders tags
role select · arguments placeholder · variants outlined, filled, borderless, underlined
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Select("Placeholder").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Select("Placeholder").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Select("Placeholder").variant("borderless"); Text("borderless").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Select("Placeholder").variant("underlined"); Text("underlined").font(.caption).foregroundStyle(.secondary) }
}Sider¶
Layout.Sider(width: 200, theme: "light", collapsed: true) { MenuItem … }
role sidebar · arguments title · defaults variant: "dark" · variants dark, light
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Sider("Title") { Text("Content"); Button("Action") }.variant("dark"); Text("dark").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Sider("Title") { Text("Content"); Button("Action") }.variant("light"); Text("light").font(.caption).foregroundStyle(.secondary) }
}Skeleton¶
Skeleton(avatar: true, lines: 3, active: true)
role skeleton
Source
Skeleton().frame(width: 160, height: 96)Space¶
Space(size: "small"|"middle"|"large", direction: "vertical") { … } — 8/16/24 px gaps
role hstack
Source
Space() { Text("Content"); Button("Action") }SpaceCompact¶
Space.Compact { Input(…); Button(…) } — joined controls
role toolbar · defaults variant: "group"
Source
SpaceCompact() { Button("Save"); Button("Share") }Spin¶
Spin(tip: "Loading…", size: "large")
role progress · arguments label · defaults kind: "spinner"
Source
Spin("Label")Statistic¶
Statistic(title: "Active Users", value: "112,893", change: "+11.28%", prefix:/suffix: via value text)
role stat · arguments title, value
Source
Statistic("Title", 60)StatisticCard¶
StatisticCard(title: "Sales", value: "¥ 126,560", change: "12%", caption: "week over week", trend: [..])
role stat · arguments title, value
Source
StatisticCard("Title", 60)StatisticCountdown¶
Statistic.Countdown(title:, value: "23:59:59")
role stat · arguments title, value
Source
StatisticCountdown("Title", 60)Steps¶
Steps(items: ["Login", ["title": "Verify", "description": "…"], "Done"], current: 1, direction: "vertical", size: "small") · errors: [1]
role steps · arguments items · variants default, navigation, inline, dot
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Steps(["One", "Two", "Three"]).variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Steps(["One", "Two", "Three"]).variant("navigation"); Text("navigation").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Steps(["One", "Two", "Three"]).variant("inline"); Text("inline").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Steps(["One", "Two", "Three"]).variant("dot"); Text("dot").font(.caption).foregroundStyle(.secondary) }
}StepsForm¶
StepsForm { Steps(…); ProForm { … } }
role vstack · defaults alignment: "stretch", spacing: 24
Source
StepsForm() { Text("Content"); Button("Action") }SubMenu¶
SubMenu("Settings", icon:, expanded: true) { MenuItem … }
role navitem · arguments label
Source
SubMenu("Label")Switch¶
Switch(checked: true, checkedChildren: "ON", size: "small", loading:)
role toggle · arguments label
Source
Switch("Label")Table¶
Table(columns: [..], rows: [[..]], rowSelection: true, selectedRows: [1], sortColumn: 2, size: "middle"|"small", bordered: true, pagination: "…") — cells may be views
role table · variants default, bordered
| 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("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Table(columns: ["Name", "Status"], rows: [["Ana Lima", "Active"], ["Ben Okafor", "Away"]]).variant("bordered"); Text("bordered").font(.caption).foregroundStyle(.secondary) }
}Tabs¶
Tabs(items: ["Overview", "Logs"], selection: 0, type: "card", size: "small") or Tabs { TabPane("One") { … } }
role tabs · arguments items · defaults placement: "top" · variants line, card, editable-card
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("card"); Text("card").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("editable-card"); Text("editable-card").font(.caption).foregroundStyle(.secondary) }
}Tag¶
Tag("processing", color: "blue"|"success"|"processing"|"error"|"warning"|"magenta"…, icon:, closable: true, bordered: false)
role chip · arguments label · variants filled, outlined, solid, borderless
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Tag("Label").variant("filled"); Text("filled").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Tag("Label").variant("outlined"); Text("outlined").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Tag("Label").variant("solid"); Text("solid").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Tag("Label").variant("borderless"); Text("borderless").font(.caption).foregroundStyle(.secondary) }
}Text¶
Typography.Text: Text("Note", type: "secondary"|"success"|"warning"|"danger") · .strong() .code() .mark() .keyboard() .delete() .underline()
role text · arguments content · variants secondary, success, warning, danger
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Text("Content").variant("secondary"); Text("secondary").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Text("Content").variant("success"); Text("success").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Text("Content").variant("warning"); Text("warning").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Text("Content").variant("danger"); Text("danger").font(.caption).foregroundStyle(.secondary) }
}TextArea¶
Input.TextArea(rows: 4, showCount: true, maxLength: 100)
role textfield · arguments placeholder · defaults kind: "multiline"
Source
TextArea("Placeholder")TimePicker¶
role datepicker · arguments placeholder · defaults kind: "time"
Source
TimePicker("Placeholder")Timeline¶
Timeline { TimelineItem("Created", color: "green", label: "2026-11-01") … } · pending:
role timeline · variants left, alternate, right
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }.variant("left"); Text("left").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }.variant("alternate"); Text("alternate").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Timeline() { TimelineItem("Created"); TimelineItem("Shipped") }.variant("right"); Text("right").font(.caption).foregroundStyle(.secondary) }
}TimelineItem¶
TimelineItem("Shipped", color: "green"|"blue"|"red"|"gray", description:, dot: "ClockCircleOutlined")
role timelineitem · arguments title
Source
TimelineItem("Title")Title¶
Title("Dashboard", level: 3) — Typography.Title h1–h5 (38/30/24/20/16 px)
role text · arguments content · defaults level: 1
Source
Title("Content")Tooltip¶
Tooltip("prompt text", placement: .bottom) { Button(…) }
role tooltip · arguments title
Source
Tooltip("Title") { Text("Content"); Button("Action") }Tour¶
Tour step bubble: Tour("Upload file", description: "…") { target }
role tooltip · arguments title
Source
Tour("Title") { Text("Content"); Button("Action") }Transfer¶
Transfer { TransferList("Source") { … }; TransferOperation(); TransferList("Target") { … } }
role hstack · defaults alignment: "center", spacing: 8
Source
Transfer() { Text("Content"); Button("Action") }TransferItem¶
role listitem · arguments title · defaults checked: False
Source
TransferItem("Title")TransferList¶
TransferList("Source", subtitle: "2/8 items") { TransferItem("Content 1", checked: true) }
role card · arguments title
Source
TransferList("Title") { Text("Content"); Button("Action") }TransferOperation¶
The two arrow buttons between TransferLists (pass children to override)
role vstack · defaults spacing: 4
Source
TransferOperation() { Text("Content"); Button("Action") }Tree¶
Tree { TreeNode("parent", expanded: true) { TreeNode("leaf") } } · showLine · checkable
role tree · variants default, directory
Source
HStack(alignment: .top, spacing: 16) {
VStack(alignment: .leading, spacing: 4) { Tree() { TreeItem("Folder") { TreeItem("File") } }.variant("default"); Text("default").font(.caption).foregroundStyle(.secondary) }
VStack(alignment: .leading, spacing: 4) { Tree() { TreeItem("Folder") { TreeItem("File") } }.variant("directory"); Text("directory").font(.caption).foregroundStyle(.secondary) }
}TreeNode¶
TreeNode("src", folder: true, expanded: true, checked: true).selected()
role treeitem · arguments title
Source
TreeNode("Title")TreeSelect¶
TreeSelect(value: "Engineering / Platform", options: [..])
role select · arguments placeholder
Source
TreeSelect("Placeholder")Typography¶
Typography("Body text") — plain text container
role text · arguments content
Source
Typography("Content")Upload¶
Upload { Button("Click to Upload", icon: "UploadOutlined"); UploadFile("spec.pdf") } — trigger + file list
role vstack · defaults alignment: "leading", spacing: 8
Source
Upload() { Text("Content"); Button("Action") }UploadDragger¶
Upload.Dragger("Click or drag file to this area to upload", hint: "Support for a single or bulk upload.")
role dropzone · arguments label · defaults icon: "InboxOutlined"
Source
UploadDragger("Label")UploadFile¶
UploadFile("report.pdf", status: "uploading"|"done"|"error") — a row of the upload list
role listitem · arguments title · defaults icon: "PaperClipOutlined"
Source
UploadFile("Title")Watermark¶
Watermark wrapper (renders its content)
role group
Source
Watermark() { 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") }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") }Dialog¶
role dialog · arguments title
Source
Dialog("Title") { Text("Content"); Button("Action") }DisclosureGroup¶
role accordion · arguments title
Source
DisclosureGroup("Title") { Text("Content"); Button("Action") }EmptyState¶
title, systemImage:, description: { actions }
role emptystate · arguments title
Source
EmptyState("Title")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") }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") }Map¶
pins: [(x%, y%, "label")], route:, showsUserLocation:, height:
role map
Source
Map().frame(width: 160, height: 96)MessageBubble¶
MessageBubble("Hi", from: .me|.them, author:, time:, status:, reactions: [..])
role message · arguments text
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)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") }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)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")ToolbarItem¶
ToolbarItem(placement: .topBarTrailing) { … }
role toolbaritem
Source
ToolbarItem() { Text("Content"); Button("Action") }ToolbarItemGroup¶
role toolbaritem
Source
ToolbarItemGroup() { Text("Content"); Button("Action") }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") }