Ant Design (React) — Practical Front-end Design Skill
Use this skill when you are building a React UI with Ant Design (antd) and want consistent, non-ugly screens fast.
When to use
- The project uses React + Ant Design
- You need to design/implement pages with: Layout, Menu, Form, Table, Modal, Drawer, Steps, Tabs, Pagination
- You need to implement theme tokens (colors, radius, typography, spacing)
- You want predictable UI patterns (CRUD screens, dashboards, settings pages)
Default workflow (do this order)
- Confirm stack: React + antd version (v5+ assumed).
- Choose page pattern:
- CRUD list (Table) + filters (Form) + actions (Modal/Drawer)
- Wizard (Steps)
- Settings (Form + Cards)
- Dashboard (Grid + Cards + Charts)
- Build layout skeleton first:
Layout + Sider + Header + Content
- Navigation with
Menu
- Build the main interaction component:
- Forms:
Form, Form.Item, Input, Select, DatePicker, Switch
- Tables:
Table + column definitions + row actions
- Add feedback loop:
message, notification, Modal.confirm
- Apply theming/tokens via
ConfigProvider (global) and component-level overrides.
- Verify:
- Empty states
- Loading states
- Error states
- Mobile responsiveness (at least: 360px layout sanity)
Component patterns (copy/paste mental models)
Layout
- Use
Layout with Sider (collapsible), Header for top actions, Content scroll.
- Put page title + primary CTA in a
Flex (or Space) row.
Forms
- Keep forms vertical; align labels consistently.
- Use
Form + Form.Item rules for validation; avoid custom validation unless necessary.
- Use
Form.useForm() and form.setFieldsValue() for edit flows.
Tables (CRUD)
- Columns:
- left: identifier/name
- middle: important attributes
- right: actions (Edit/Delete)
- Use
rowKey always.
- Use server-side pagination for real apps.
Modals/Drawers
- Modal for short forms.
- Drawer for longer forms or when you want context kept.
Theming / Tokens (AntD v5)
Ant Design v5 uses Design Tokens and CSS-in-JS.
Global theme
Wrap your app in ConfigProvider:
import { ConfigProvider, theme } from 'antd';
export function AppProviders({ children }: { children: React.ReactNode }) {
return (
<ConfigProvider
theme={{
algorithm: theme.defaultAlgorithm,
token: {
colorPrimary: '#1677ff',
borderRadius: 10,
fontSize: 14,
},
components: {
Button: { controlHeight: 40 },
Layout: { headerBg: '#ffffff' },
},
}}
>
{children}
</ConfigProvider>
);
}
Dark mode
Use theme.darkAlgorithm and keep tokens consistent:
const isDark = true;
<ConfigProvider
theme={{
algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: { colorPrimary: '#7c3aed' },
}}
/>
Component-level overrides
Use components.<ComponentName> for specific tweaks (Button, Input, Table, etc.).
References
- Read README.md for the full “how-to” (setup + patterns + examples).
- Use
protocols/ when you want LLM-first contracts (describe UIs as data, then generate code deterministically).
- Read
references/tokens.md for a tokens cookbook.
- Read
references/components.md for practical page recipes (CRUD, Settings, Wizard).
- Use
examples/ when you want ready-to-copy AntD screens.
- Use
starter/ when you need a runnable Vite + React + AntD skeleton.
Guardrails
- Assume Ant Design v5+ (tokens). If project is v4 (Less variables), stop and ask.
- Prefer built-in components and patterns over custom CSS.
- Avoid over-theming: set a small set of tokens and only override components when needed.
1---
2name: ant-design-skill
3description: "Front-end design skill for building React UIs with Ant Design
4 (antd): component patterns, layout, forms, tables, and theming/tokens via
5 ConfigProvider."
6metadata:
7 source: https://skillmd.com/skills/modbender/ant-design-skill
8---
9
10
11# Ant Design (React) — Practical Front-end Design Skill
12
13Use this skill when you are building a React UI with **Ant Design (antd)** and want **consistent, non-ugly** screens fast.
14
15## When to use
16- The project uses **React** + **Ant Design**
17- You need to design/implement pages with: **Layout**, **Menu**, **Form**, **Table**, **Modal**, **Drawer**, **Steps**, **Tabs**, **Pagination**
18- You need to implement **theme tokens** (colors, radius, typography, spacing)
19- You want predictable UI patterns (CRUD screens, dashboards, settings pages)
20
21## Default workflow (do this order)
221) Confirm stack: React + antd version (v5+ assumed).
232) Choose page pattern:
24 - CRUD list (Table) + filters (Form) + actions (Modal/Drawer)
25 - Wizard (Steps)
26 - Settings (Form + Cards)
27 - Dashboard (Grid + Cards + Charts)
283) Build layout skeleton first:
29 - `Layout` + `Sider` + `Header` + `Content`
30 - Navigation with `Menu`
314) Build the main interaction component:
32 - Forms: `Form`, `Form.Item`, `Input`, `Select`, `DatePicker`, `Switch`
33 - Tables: `Table` + column definitions + row actions
345) Add feedback loop:
35 - `message`, `notification`, `Modal.confirm`
366) Apply theming/tokens via `ConfigProvider` (global) and component-level overrides.
377) Verify:
38 - Empty states
39 - Loading states
40 - Error states
41 - Mobile responsiveness (at least: 360px layout sanity)
42
43## Component patterns (copy/paste mental models)
44### Layout
45- Use `Layout` with `Sider` (collapsible), `Header` for top actions, `Content` scroll.
46- Put page title + primary CTA in a `Flex` (or `Space`) row.
47
48### Forms
49- Keep forms vertical; align labels consistently.
50- Use `Form` + `Form.Item` rules for validation; avoid custom validation unless necessary.
51- Use `Form.useForm()` and `form.setFieldsValue()` for edit flows.
52
53### Tables (CRUD)
54- Columns:
55 - left: identifier/name
56 - middle: important attributes
57 - right: actions (Edit/Delete)
58- Use `rowKey` always.
59- Use server-side pagination for real apps.
60
61### Modals/Drawers
62- **Modal** for short forms.
63- **Drawer** for longer forms or when you want context kept.
64
65## Theming / Tokens (AntD v5)
66Ant Design v5 uses **Design Tokens** and CSS-in-JS.
67
68### Global theme
69Wrap your app in `ConfigProvider`:
70
71```tsx
72import { ConfigProvider, theme } from 'antd';
73
74export function AppProviders({ children }: { children: React.ReactNode }) {
75 return (
76 <ConfigProvider
77 theme={{
78 algorithm: theme.defaultAlgorithm,
79 token: {
80 colorPrimary: '#1677ff',
81 borderRadius: 10,
82 fontSize: 14,
83 },
84 components: {
85 Button: { controlHeight: 40 },
86 Layout: { headerBg: '#ffffff' },
87 },
88 }}
89 >
90 {children}
91 </ConfigProvider>
92 );
93}
94```
95
96### Dark mode
97Use `theme.darkAlgorithm` and keep tokens consistent:
98
99```tsx
100const isDark = true;
101
102<ConfigProvider
103 theme={{
104 algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm,
105 token: { colorPrimary: '#7c3aed' },
106 }}
107/>
108```
109
110### Component-level overrides
111Use `components.<ComponentName>` for specific tweaks (Button, Input, Table, etc.).
112
113## References
114- Read **README.md** for the full “how-to” (setup + patterns + examples).
115- Use `protocols/` when you want LLM-first contracts (describe UIs as data, then generate code deterministically).
116- Read `references/tokens.md` for a tokens cookbook.
117- Read `references/components.md` for practical page recipes (CRUD, Settings, Wizard).
118- Use `examples/` when you want ready-to-copy AntD screens.
119- Use `starter/` when you need a runnable Vite + React + AntD skeleton.
120
121## Guardrails
122- Assume Ant Design v5+ (tokens). If project is v4 (Less variables), stop and ask.
123- Prefer built-in components and patterns over custom CSS.
124- Avoid over-theming: set a small set of tokens and only override components when needed.