Use this skill when you are building a React UI with Ant Design (antd) and want consistent, non-ugly screens fast.
1) Confirm stack: React + antd version (v5+ assumed). 2) Choose page pattern:
Layout + Sider + Header + ContentMenu
4) Build the main interaction component:Form, Form.Item, Input, Select, DatePicker, SwitchTable + column definitions + row actions
5) Add feedback loop:來源於7w4.net。
message, notification, Modal.confirm
6) Apply theming/tokens via ConfigProvider (global) and component-level overrides.
7) Verify:Layout with Sider (collapsible), Header for top actions, Content scroll.Flex (or Space) row.Form + Form.Item rules for validation; avoid custom validation unless necessary.Form.useForm() and form.setFieldsValue() for edit flows.rowKey always.Ant Design v5 uses Design Tokens and CSS-in-JS.
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>
);
}
Use theme.darkAlgorithm and keep tokens consistent:
const isDark = true;
<ConfigProvider
theme={{
algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: { colorPrimary: '#7c3aed' },
}}
/>
Use components.<ComponentName> for specific tweaks (Button, Input, Table, etc.).
protocols/ when you want LLM-first contracts (describe UIs as data, then generate code deterministically).references/tokens.md for a tokens cookbook.references/components.md for practical page recipes (CRUD, Settings, Wizard).examples/ when you want ready-to-copy AntD screens.starter/ when you need a runnable Vite + React + AntD skeleton.這個技能庫質量不錯,提供了完整的 React + Ant Design UI 開發指南,涵蓋常用的 CRUD 頁面、表單、表格、主題配置等場景,文件清晰易讀。優點是內容全面、結構規範,有可直接使用的程式碼示例和設計規則。不足之處是示例程式碼存在語言混用問題,且缺少測試相關指導,部分協議文件可以更詳細。整體而言,這是一個實用且可靠的開發技能資源。