Ant design

From oyi77/1ai-skills · View interactive version

Ant design is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when ant Design React component library — enterprise UI, forms, tables, charts, theming, ProComponents.

How to use this skill

Skill file

Overview

Ant Design is an enterprise-grade React UI library with 60+ components, a design system, and ProComponents for advanced business scenarios. Widely used for admin dashboards, CMS, and data-heavy applications.

Capabilities

When to Use

Trigger phrases:

When NOT to Use

Pseudo Code

The ant-design workflow follows a standard pipeline pattern.

Core flow:

# ant-design primary flow
input = prepare(raw_data)
result = process(input, config={ant, charts, component, design, enterprise})
validate(result)
deliver(result)

Error handling:

on error:
  log(error_details)
  retry_with_backoff(max=3)
  if still_failing: alert_and_escalate()

Core Workflow

# ant-design primary flow
input = prepare(raw_data)
result = process(input, config={ant, charts, component, design, enterprise})
validate(result)
deliver(result)

Error Handling

on error:
  log(error_details)
  retry_with_backoff(max=3)
  if still_failing: alert_and_escalate()

Installation

npm install antd @ant-design/icons
# ProComponents for advanced patterns
npm install @ant-design/pro-components

Theme Configuration

import { ConfigProvider } from "antd"

function App() {
  return (
    <ConfigProvider
      theme={{
        token: {
          colorPrimary: "#1677ff",
          borderRadius: 6,
          fontFamily: "Inter, sans-serif",
        },
      }}
    >
      <YourApp />
    </ConfigProvider>
  )
}

Form with Validation

import { Form, Input, Select, Button, message } from "antd"

export function UserForm() {
  const [form] = Form.useForm()
  const onFinish = (values) => {
    message.success("Saved!")
    console.log(values)
  }

  return (
    <Form form={form} layout="vertical" onFinish={onFinish}>
      <Form.Item name="name" label="Name" rules={[{ required: true }]}>
        <Input />
      </Form.Item>
      <Form.Item name="role" label="Role" rules={[{ required: true }]}>
        <Select options={[{ value: "admin" }, { value: "user" }]} />
      </Form.Item>
      <Button type="primary" htmlType="submit">Save</Button>
    </Form>
  )
}

ProTable

import { ProTable } from "@ant-design/pro-components"

const columns = [
  { title: "Name", dataIndex: "name", sorter: true },
  { title: "Status", dataIndex: "status", valueEnum: { active: "Active", inactive: "Inactive" } },
  { title: "Created", dataIndex: "createdAt", valueType: "date" },
]

export function UserTable() {
  return (
    <ProTable
      columns={columns}
      request={async (params) => {
        const data = await fetchUsers(params)
        return { data: data.list, total: data.total }
      }}
      search={{ labelWidth: "auto" }}
      pagination={{ pageSize: 20 }}
    />
  )
}

Common Patterns

How to Use

  1. Define content goal (traffic, engagement, conversion, brand awareness)
  2. Research target audience pain points and search intent
  3. Generate content using appropriate AI tools
  4. Edit and humanize output for authenticity
  5. Optimize for target platform (SEO, hashtags, format)
  6. Schedule and distribute across channels
  7. Measure performance and iterate

Red Flags

Verification

Process

  1. Analyze the task requirements
  2. Apply domain expertise
  3. Verify output quality

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "Good enough content works" | Quality content drives engagement. Mediocre content gets ignored. |

| "I will optimize later" | SEO and distribution need optimization from the start. |

| "Templates are good enough" | Templates are a starting point. Custom content outperforms generic. |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.