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:message, notification, Modal.confirm
6) Apply theming/tokens via ConfigProvider (global) and component-level overrides.
7) Verify:本技能来自小葱技能站7w4.net。
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 页面、表单、表格、主题配置等场景,文档清晰易读。优点是内容全面、结构规范,有可直接使用的代码示例和设计规则。不足之处是示例代码存在语言混用问题,且缺少测试相关指导,部分协议文档可以更详细。整体而言,这是一个实用且可靠的开发技能资源。