Ant Design¶
The antd pack imitates Ant Design v5 for React together with
ProComponents (ProLayout, PageContainer, ProTable, ProForm, QueryFilter, ProCard,
StatisticCard), in the default token theme: seed colour colorPrimary #1677ff, borderRadius 6
(4 small, 8 large), controlHeight 32 (24 / 40), 14 px system font with a 1.5715 line height, the
grey colorBgLayout page behind white containers and the AntV G2 categorical palette for charts.
Dark mode follows theme.darkAlgorithm (#141414 containers on black, primary #1668dc). Select it with
import Antd // or: import AntDesign, import ProComponents
Elements use the antd component and prop names. Where antd nests names (Form.Item, Badge.Ribbon,
Input.Password, Upload.Dragger, Descriptions.Item) the pack joins them: FormItem, BadgeRibbon,
InputPassword, UploadDragger, DescriptionsItem, TabPane, CollapsePanel, RangePicker. Props
keep their antd spelling: Button(type: "primary" | "default" | "dashed" | "text" | "link") (or the
v5.21 color: + variant: pair) with .danger(), size: "small" | "large", shape: "circle";
Input(status: "error", addonAfter:, allowClear:); Form(layout: "horizontal" | "vertical" |
"inline"); Select(mode: "multiple"); Radio.Group as RadioGroup(optionType: "button");
Alert(message:, description:, type:, showIcon:); Badge(count:), Badge(status:, text:);
Tag(color: "magenta" … "purple" | "success" | "processing" | "error" | "warning");
Table(rowSelection:, bordered:, size: "middle" | "small"); Steps(items:, current:);
TimelineItem(color:); Result(status:, subTitle:); Statistic(title:, value:); Progress(percent:,
type: "circular"). Modal, Drawer, Message (message.success), Notification, Popconfirm,
Popover, Tooltip and Dropdown render as open overlays. Ant icon names ("UserOutlined",
"SettingFilled", "InboxOutlined") work wherever an icon is accepted.
The examples import a few Pro blocks from
mockups/antd/pro.mockitdown (import "antd/pro"): ChartCard and Trend for
the analysis KPIs, OrderStatus for status badges, RowActions for a table's operation column and
TransferBox for a two-list Transfer.
Sign in¶
The ProComponents login page: logo and slogan, Tabs for the sign-in method, large inputs with
prefix icons, "Auto sign-in", a block primary Button and the alternative sign-in row.
Source
import Antd
@Screen(title: "Sign in", id: "ANTD-1")
VStack(spacing: 32) {
Spacer()
VStack(spacing: 12) {
HStack(spacing: 16) {
Image("assets/images/logo.svg").frame(width: 44, height: 44)
Title("Northwind Console", level: 2)
}
Text("The operations console for the Northwind delivery fleet", type: "secondary")
}
VStack(alignment: .stretch, spacing: 24) {
Tabs(items: ["Account sign-in", "Phone sign-in"], selection: 0)
Input("Username", value: "dispatch.admin", icon: "UserOutlined", size: "large")
InputPassword("Password", icon: "LockOutlined", size: "large", status: "focused")
HStack {
Checkbox("Auto sign-in", checked: true)
Spacer()
Link("Forgot password")
}
Button("Sign in", type: "primary", size: "large").block()
HStack(spacing: 8) {
Text("Sign in with")
Button(icon: "MobileOutlined", type: "text", shape: "circle", size: "small")
Button(icon: "MailOutlined", type: "text", shape: "circle", size: "small")
Button(icon: "SafetyCertificateOutlined", type: "text", shape: "circle", size: "small")
Spacer()
Link("Create an account")
}
}
.frame(width: 328)
Spacer()
Text("Northwind Console · ©2026 Northwind Logistics", type: "secondary")
}
.padding(24)
.frame(maxWidth: .infinity, maxHeight: .infinity)Basic form¶
A horizontal Form inside a Card: right-aligned labels with colons and required marks, an Input
in the error state, a RangePicker, a counted TextArea, single and multiple Select, Cascader,
InputNumber with an addon, a button-style RadioGroup, Switch, Slider, and an Upload with its
file list. The actions sit in the control column.
Source
import Antd
@Screen(title: "New project", id: "ANTD-2")
VStack(alignment: .stretch, spacing: 16) {
Breadcrumb(["Home", "Projects", "New project"])
Card(title: "New project") {
Form(layout: "horizontal") {
Input("Give the project a name", label: "Project name", value: "Q1 route optimisation", required: true)
RangePicker(label: "Start and end", value: "2026-12-01 → 2027-03-31", required: true)
TextArea("Describe the goal", label: "Goal", value: "Cut empty kilometres on the northern routes by re-planning the depot hand-offs.", rows: 3, required: true, showCount: "86 / 200")
Input("name@example.com", label: "Contact email", value: "lena.hart@northwind", status: "error", help: "Please enter a valid email address")
Select("Choose an owner", label: "Owner", value: "Lena Hart")
Select("Add reviewers", label: "Reviewers", mode: "multiple", value: ["Kai Moreno", "Ivy Chen", "Ola Berg"])
Cascader("Select a region", label: "Region", value: "Europe / Germany / Hamburg")
InputNumber(label: "Budget", value: "12,000", addonAfter: "EUR")
FormItem("Visibility") {
RadioGroup(options: ["Private", "Team", "Company"], value: "Team", optionType: "button")
}
FormItem("Weekly digest") { Switch(checked: true) }
FormItem("Risk appetite") { Slider(value: 35).frame(maxWidth: .infinity) }
FormItem("Attachments") {
Upload {
Button("Click to Upload", icon: "UploadOutlined")
UploadFile("route-baseline.xlsx")
UploadFile("depot-map.pdf", status: "uploading")
UploadFile("old-plan.docx", status: "error")
}
}
} actions: {
Button("Submit", type: "primary")
Button("Save draft")
}
.frame(maxWidth: 760)
}
}
.padding(24)
.frame(maxHeight: .infinity, alignment: .top)Analysis dashboard¶
The Ant Design Pro "analysis" workspace in a ProLayout: a light ProSider with nested menus, the
global header, four KPI ChartCards (a Statistic total, trend figures, a sparkline, a column chart, a
Progress), the sales ProCard with a Segmented range switch, a column chart in the G2 palette and a
ranking list, then a small Table and a donut chart.
| Rank | Keyword | Users | WoW |
|---|---|---|---|
| 1 | route planner | 941 | 16% ▲ |
| 2 | depot hours | 778 | 3% ▼ |
| 3 | cold chain | 512 | 21% ▲ |
| Rank | Keyword | Users | WoW |
|---|---|---|---|
| 1 | route planner | 941 | 16% ▲ |
| 2 | depot hours | 778 | 3% ▼ |
| 3 | cold chain | 512 | 21% ▲ |
Order list¶
A ProTable page: the QueryFilter search form 1, the table toolbar with its primary action 2,
row selection with a sorted amount column and an open row Dropdown 3, and the FooterToolbar that
appears while rows are selected 4. Status cells use the status Badge, tags use Tag presets.
| Order no. | Customer | Status | Amount | Created | Tags | Actions | |
|---|---|---|---|---|---|---|---|
| NW-26-1048 | Harbour Foods | Paid | € 1,240.00 | 2026-11-23 09:14 | express | ViewEdit | |
| NW-26-1047 | Lindqvist & Co | Shipping | € 880.50 | 2026-11-23 08:02 | cold chain | ViewEdit | |
| NW-26-1046 | Pier 9 Market | Overdue | € 2,315.00 | 2026-11-22 17:41 | priority | ViewEdit | |
| NW-26-1045 | Ostrander Mills | Paid | € 412.80 | 2026-11-22 11:20 | pallet | ViewEdit | |
| NW-26-1044 | Café Mirabel | Pending | € 96.00 | 2026-11-21 16:05 | sample | ViewEdit | |
| NW-26-1043 | Brightwater Labs | Refunded | € 1,075.30 | 2026-11-21 10:48 | returns | ViewEdit | |
| NW-26-1042 | Kestrel Outfitters | Shipping | € 658.00 | 2026-11-20 14:33 | express | ViewEdit |
Source
import Antd
import "antd/pro"
@Screen(title: "Orders", id: "ANTD-4")
ProLayout {
ProSider("Northwind Pro", collapsed: true) {
MenuItem("Dashboard", icon: "DashboardOutlined")
MenuItem("Orders", icon: "ShoppingCartOutlined").selected()
MenuItem("Customers", icon: "TeamOutlined")
MenuItem("Fleet", icon: "CarOutlined")
MenuItem("Settings", icon: "SettingOutlined")
} header: {
Image("assets/images/logo.svg").frame(width: 28, height: 28)
}
VStack(alignment: .stretch, spacing: 0) {
PageContainer(title: "Order list") {
QueryFilter {
ProFormText("Order no.", placeholder: "Please enter")
ProFormSelect("Status", value: "All")
ProFormDateRangePicker("Created", placeholder: "Start date → End date")
} actions: {
Button("Reset")
Button("Query", type: "primary")
Link("Expand", icon: "DownOutlined")
}
.callout(1, "QueryFilter", alignment: .topTrailing, labelSide: .leading)
ProTable(headerTitle: "Orders", columns: ["Order no.", "Customer", "Status", Column("Amount", alignment: .trailing), "Created", "Tags", "Actions"], rows: [
[Link("NW-26-1048"), "Harbour Foods", OrderStatus(status: "Paid"), "€ 1,240.00", "2026-11-23 09:14", Tag("express", color: "blue"), RowActions()],
[Link("NW-26-1047"), "Lindqvist & Co", OrderStatus(status: "Shipping"), "€ 880.50", "2026-11-23 08:02", Tag("cold chain", color: "cyan"), RowActions()],
[Link("NW-26-1046"), "Pier 9 Market", OrderStatus(status: "Overdue"), "€ 2,315.00", "2026-11-22 17:41", Tag("priority", color: "volcano"), HStack(spacing: 16) {
Link("View")
Link("Edit")
Dropdown(icon: "MoreOutlined", type: "text", size: "small", open: true) {
DropdownItem("Duplicate", icon: "CopyOutlined")
DropdownItem("Export PDF", icon: "FilePdfOutlined")
MenuDivider()
DropdownItem("Delete", icon: "DeleteOutlined", danger: true)
}
}],
[Link("NW-26-1045"), "Ostrander Mills", OrderStatus(status: "Paid"), "€ 412.80", "2026-11-22 11:20", Tag("pallet", color: "geekblue"), RowActions()],
[Link("NW-26-1044"), "Café Mirabel", OrderStatus(status: "Pending"), "€ 96.00", "2026-11-21 16:05", Tag("sample", color: "gold"), RowActions()],
[Link("NW-26-1043"), "Brightwater Labs", OrderStatus(status: "Refunded"), "€ 1,075.30", "2026-11-21 10:48", Tag("returns", color: "purple"), RowActions()],
[Link("NW-26-1042"), "Kestrel Outfitters", OrderStatus(status: "Shipping"), "€ 658.00", "2026-11-20 14:33", Tag("express", color: "blue"), RowActions()]
], rowSelection: true, selectedRows: [1, 2], sortColumn: 3) toolbar: {
Spacer()
Button("New order", type: "primary", icon: "PlusOutlined").callout(2, "Toolbar", alignment: .topLeading)
Button(icon: "ReloadOutlined", type: "text")
Button(icon: "ColumnHeightOutlined", type: "text")
Button(icon: "SettingOutlined", type: "text")
} footer: {
Pagination(count: 9, current: 1, showTotal: "1-7 of 61 items")
}
.callout(3, "Row selection + sorter", alignment: .bottomTrailing, labelSide: .leading)
}
FooterToolbar {
Text("Selected **2** items · Total amount € 3,195.50")
Spacer()
Button("Batch delete")
Button("Batch approve", type: "primary")
}
.callout(4, "FooterToolbar", alignment: .topLeading)
}
}The query form 1 is a QueryFilter — a three-column horizontal form with Reset / Query / Expand.
The toolbar 2 holds the page's primary action and the density, reload and column-settings icons.
The table 3 has rowSelection, a sorted column (the blue caret) and a row's "more" Dropdown; while
rows are selected the FooterToolbar 4 offers the batch actions.
Order detail¶
The "advanced profile" page under a top-navigation layout: the dark Header with a horizontal dark
Menu, a PageContainer with breadcrumb, title, extra buttons and Statistics, a progress Steps, a
bordered Descriptions, a line-item Table and an activity Timeline.
| SKU | Product | Qty | Unit price | Total |
|---|---|---|---|---|
| P-2210 | Insulated crate, 60 l | 40 | € 24.50 | € 980.00 |
| P-1185 | Pallet wrap, 500 m | 12 | € 18.75 | € 225.00 |
| P-3302 | Temperature logger | 15 | € 74.00 | € 1,110.00 |
Team members¶
A classic Layout with a dark Sider, a light Header and a Card holding a member List with
CheckableTag filters, role Tags, status Badges and an Avatar.Group. The invite Modal is open
with a vertical Form, a message.success toast confirms the last action, and a FloatButton sits in
the corner.
Source
import Antd
@Screen(title: "Members", id: "ANTD-6")
Layout(hasSider: true) {
Sider("Northwind") {
MenuItem("Overview", icon: "AppstoreOutlined")
SubMenu("Team", icon: "TeamOutlined", expanded: true) {
MenuItem("Members").selected()
MenuItem("Roles")
MenuItem("Invitations")
}
MenuItem("Billing", icon: "WalletOutlined")
MenuItem("Settings", icon: "SettingOutlined")
} header: {
Image("assets/images/logo.svg").frame(width: 28, height: 28)
}
Layout {
Header(theme: "light") {
Badge(count: 3) { Button(icon: "BellOutlined", type: "text") }
Avatar("Mara Quinn", size: "small")
} center: {
Breadcrumb(["Team", "Members"])
}
Content {
Card(title: "Members") {
HStack(spacing: 8) {
Text("Roles:", type: "secondary")
CheckableTag("All", checked: true)
CheckableTag("Admins")
CheckableTag("Dispatch")
CheckableTag("Drivers")
CheckableTag("Finance")
Spacer()
AvatarGroup {
Avatar("Lena Hart")
Avatar("Kai Moreno")
Avatar("Ivy Chen")
Avatar("+9", shape: "circle")
}
}
List {
ListItem("Lena Hart", description: "lena.hart@northwind.example", avatar: "Lena Hart") {
Tag("admin", color: "magenta")
Badge(status: "success", text: "Active").frame(width: 110)
Link("Edit")
}
ListItem("Kai Moreno", description: "kai.moreno@northwind.example", avatar: "Kai Moreno") {
Tag("dispatch", color: "geekblue")
Badge(status: "success", text: "Active").frame(width: 110)
Link("Edit")
}
ListItem("Ivy Chen", description: "ivy.chen@northwind.example", avatar: "Ivy Chen") {
Tag("finance", color: "green")
Badge(status: "warning", text: "Invited").frame(width: 110)
Link("Edit")
}
ListItem("Ola Berg", description: "ola.berg@northwind.example", avatar: "Ola Berg") {
Tag("driver", color: "orange")
Badge(status: "default", text: "Suspended").frame(width: 110)
Link("Edit")
}
}
HStack {
Spacer()
Pagination(count: 3, current: 1, size: "small")
}
} extra: {
InputSearch("Search members").frame(width: 220)
Button("Invite member", type: "primary", icon: "UserAddOutlined")
}
}
}
}
Modal(title: "Invite member") {
Form(layout: "vertical") {
Input("name@example.com", label: "Email addresses", value: "noor.sahin@northwind.example", required: true)
Select("Select a role", label: "Role", value: "Dispatch", required: true)
Checkbox("Send a welcome email with the getting-started guide", checked: true)
}
} footer: {
Button("Cancel")
Button("Send invitation", type: "primary")
}
Message("Ola Berg was suspended", type: "success", icon: "CheckCircleFilled")
FloatButton(icon: "QuestionCircleOutlined")Import wizard¶
A step-by-step import (Steps with a finished, a current and two waiting steps): an info Alert, the
Upload.Dragger with its file, a Transfer that picks the columns to import, a circular Progress,
and a notification in the top-right corner.
Roles and permissions¶
A Drawer editing a role over the roles page: a checkable Tree of permissions, a Collapse of
advanced options with Switches and a ColorPicker, and a footer. Behind it the page shows a loading
Skeleton card, an Empty state and a Popconfirm on a delete button.
Submission result¶
A Result page after a purchase: the success icon, title, sub-title and actions, the order summary in a
bordered Descriptions, a dotted Steps for what happens next, a Rate prompt and two plan cards, one
marked with a Badge.Ribbon.