ant-design-v6

ant-design-v6 is a cursor rule for Cursor from aide-family/moon-web. It costs 0 tokens per session (1,238 once invoked), scanned A, original, MIT.

A set of coding rules for Ant Design version 6, a React component library for building user interfaces. It describes the current APIs and the older APIs that should no longer be used.

In plain words
What is it for?
Use it when writing or reviewing Ant Design v6 code, updating older components, or checking which replacement API to use.
Why use it?
It helps prevent code from using removed or outdated Ant Design features. It also keeps component usage, icons, themes, and pop-up behavior consistent with version 6.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when writing or reviewing Ant Design v6 code, updating older components, or checking which replacement API to use.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/aide-family/moon-web/ant-design-v6
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/aide-family/moon-web

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ant-design-v6

README.md
[![agentmods](https://agentmods.dev/badge/rules/aide-family/moon-web/ant-design-v6/github.svg)](https://agentmods.dev/rules/aide-family/moon-web/ant-design-v6)
Your own site
<a href="https://agentmods.dev/rules/aide-family/moon-web/ant-design-v6"><img src="https://agentmods.dev/badge/rules/aide-family/moon-web/ant-design-v6/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ant-design-v6

Your own site · 80×15
<a href="https://agentmods.dev/rules/aide-family/moon-web/ant-design-v6"><img src="https://agentmods.dev/badge/rules/aide-family/moon-web/ant-design-v6.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,238 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01238
Opus 5 $0.00000 $0.00619
Sonnet 5 $0.00000 $0.00248
Haiku 4.5 $0.00000 $0.00124

Measured 9d ago against content hash 2c3908e7376c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ant-design-v6 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ant-design-v6.mdc · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ant Design v6 组件库规范

编写 Ant Design 代码时,以官方文档为准:**https://ant.design/llms-full.txt**(完整组件 API)与 **https://ant.design/components/overview-cn/**(组件总览)。本项目使用 antd@^6,仅使用 v6 推荐 API,禁止已废弃写法。

全局与上下文

  • 根节点:ConfigProvider 包裹 AppApp.useApp() 须在 <App> 子树内调用。
  • 静态方法:优先 const { message, modal, notification } = App.useApp(),避免直接 message.success() / Modal.confirm()(上下文与主题可能不一致)。
  • 图标:从 @ant-design/icons 按需引入;antd 内置 Icon 组件已在 v6 移除。
  • 类型工具:GetRefGetPropsGetProp 用于提取组件 ref/props 类型。
import type { GetProps } from 'antd'
type SelectOption = GetProp<typeof Select, 'options'>[number]

v6 已移除 / 禁止使用的 API

废弃 替代
visible / onVisibleChange open / onOpenChange
destroyOnClose / destroyPopupOnHide destroyOnHidden
bodyStyle / headStyle / overlayStyle / overlayClassName styles.* / classNames.*(语义化 DOM)
dropdownRender / dropdownClassName popupRender / classNames.popup.root
ListBackTopDropdown.Buttonantd/Icon 不用或改用 Flex/SpaceFloatButtonSpace.Compact
Notification.message title
Tabs.tabPosition tabPlacementstart/end 逻辑位置)
Tablefixed: 'left'/'right' fixed: 'start'/'end'
pagination.position pagination.placement
Space.direction / split orientation / separator
Divider.type orientationvertical 语法糖)
Collapse.expandIconPosition expandIconPlacement
Steps.labelPlacement titlePlacement
Table rowKey 函数第二参数 index 仅用 record 的稳定字段

常用组件要点

Modal / Drawer

  • 受控:open + onCancel;提交用 confirmLoading
  • 关闭时回收本地 state;详情弹窗可用 footer={null}
  • 样式:styles={{ body: {...} }},不用 bodyStyle

Form

  • const [form] = Form.useForm();提交 form.validateFields()
  • 校验失败(errorFields)直接 return;其它异常记录并提示。
  • 动态字段:Form.useWatch(v6 支持动态 name path);联动用 shouldUpdatedependencies
  • Checkbox/Switch 绑定:valuePropName="checked"

Table

  • 必须设 rowKey(业务稳定字段,如 uid);列类型 ColumnsType<RowType>
  • 分页受控:pagination={{ current, pageSize, total }} + onChange
  • 列渲染处理 undefinedemptyPlaceholder'-')。

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 96 lines · 0 tokens per session scan A 2c3908e7376c

Subscribe to this mod's changes

ant-design-v6 is a cursor rule published in the GitHub repository aide-family/moon-web (12 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,238 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.