ant-design-mini
When to use this skill
Use this skill whenever the user wants to:
- Build Alipay or WeChat mini-program UIs with Ant Design Mini components
- Use form, data display, feedback, or navigation components in mini-programs
- Customize the Ant Design Mini theme via CSS variables
- Handle component events and lifecycle in mini-program contexts
How to use this skill
Quick-Start Example: Button and Form in Mini-Program
<!-- pages/index/index.axml -->
<ant-button type="primary" onTap="handleClick">Submit</ant-button>
<ant-form onFinish="onFormFinish">
<ant-form-item label="Name" name="name" required="{{true}}">
<ant-input placeholder="Enter your name" />
</ant-form-item>
<ant-form-item label="Phone" name="phone">
<ant-input type="number" placeholder="Enter phone" />
</ant-form-item>
<ant-button type="primary" form-type="submit">Submit</ant-button>
</ant-form>
// pages/index/index.js
Page({
handleClick() { my.showToast({ content: 'Clicked!' }); },
onFormFinish(values) { console.log('Form values:', values); }
});
This skill is organized to match the Ant Design Mini official documentation structure (https://ant-design-mini.antgroup.com/guide/quick-start, https://ant-design-mini.antgroup.com/components/overview). When working with Ant Design Mini:
-
Identify the topic from the user's request:
- Getting started/快速开始 →
examples/getting-started.md - Components/组件 →
examples/components/ - API/API 文档 →
api/
- Getting started/快速开始 →
-
Load the appropriate example file from the
examples/directory:Getting Started (快速开始):
examples/getting-started.md- Installation and setupexamples/quick-start.md- Quick start guide
Components (组件):
examples/components/overview.md- Components overviewexamples/components/button.md- Button componentexamples/components/input.md- Input componentexamples/components/form.md- Form componentexamples/components/list.md- List componentexamples/components/card.md- Card componentexamples/components/toast.md- Toast componentexamples/components/modal.md- Modal componentexamples/components/tabs.md- Tabs componentexamples/components/nav-bar.md- NavBar componentexamples/components/picker.md- Picker componentexamples/components/date-picker.md- DatePicker componentexamples/components/switch.md- Switch componentexamples/components/checkbox.md- Checkbox componentexamples/components/radio.md- Radio componentexamples/components/stepper.md- Stepper componentexamples/components/avatar.md- Avatar componentexamples/components/badge.md- Badge componentexamples/components/tag.md- Tag componentexamples/components/empty.md- Empty componentexamples/components/loading.md- Loading componentexamples/components/popup.md- Popup componentexamples/components/action-sheet.md- ActionSheet component
-
Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Ant Design Mini is for Alipay Mini Program and WeChat Mini Program
- Components use mini-program syntax (axml/json)
- Examples include both Alipay and WeChat syntax
- Each example file includes key concepts, code examples, and key points
-
Reference API documentation in the
api/directory when needed:api/component-api.md- Component API referenceapi/props-and-events.md- Props and events reference
-
Use templates from the
templates/directory:templates/installation.md- Installation templatestemplates/component-usage.md- Component usage templates
1. Understanding Ant Design Mini
Ant Design Mini is a UI component library for Alipay Mini Program and WeChat Mini Program, following Ant Design design specifications.
Key Concepts:
- Mini Program Support: Alipay and WeChat Mini Programs
- Design System: Follows Ant Design design language
- Rich Components: Button, Form, List, Modal, etc.
- Theme Customization: Support for theme customization
- i18n: Internationalization support
2. Installation
Using npm:
npm install antd-mini
Using yarn:
yarn add antd-mini
Using pnpm:
pnpm add antd-mini
3. Basic Setup
// app.json (Alipay Mini Program)
{
"usingComponents": {
"ant-button": "antd-mini/es/Button/index"
}
}
<!-- page.axml -->
<ant-button type="primary" onTap="handleTap">Button</ant-button>
Doc mapping (one-to-one with official documentation)
Guide (指南):
- See guide files in
examples/guide/orexamples/getting-started/→ https://ant-design-mini.antgroup.com/guide/quick-start
Components (组件):
- See component files in
examples/components/→ https://ant-design-mini.antgroup.com/components/overview
Examples and Templates
This skill includes detailed examples organized to match the official documentation structure. All examples are in the examples/ directory (see mapping above).
To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in
templates/directory for common scaffolding - Adapt templates to your specific needs and coding style
API Reference
Detailed API documentation is available in the api/ directory, organized to match the official Ant Design Mini API documentation structure:
Component API (api/component-api.md)
- Component props and events
- Component methods
- Component slots
Props and Events (api/props-and-events.md)
- Common props
- Common events
- Event handling
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the
api/directory - Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the
examples/directory
Best Practices
- Register components: Register components in app.json or page.json
- Use correct syntax: Use axml for Alipay, wxml for WeChat
- Handle events: Use onTap for Alipay, bindtap for WeChat
- Customize theme: Use theme variables for customization
- Follow design specs: Follow Ant Design design specifications
Resources
- Official Documentation: https://ant-design-mini.antgroup.com/
- Quick Start: https://ant-design-mini.antgroup.com/guide/quick-start
- Components: https://ant-design-mini.antgroup.com/components/overview
- GitHub Repository: https://github.com/ant-design/ant-design-mini
Keywords
Ant Design Mini, ant-design-mini, antd-mini, mini program, Alipay Mini Program, WeChat Mini Program, 小程序, 支付宝小程序, 微信小程序, 组件库, UI components, Button, Form, List, Modal, Toast, Tabs, NavBar, 按钮, 表单, 列表, 弹窗, 提示, 标签页, 导航栏
More from teachingai/agent-skills
element-plus-vue3
Provides comprehensive guidance for Element Plus Vue 3 component library including installation, components, themes, internationalization, and API reference. Use when the user asks about Element Plus for Vue 3, needs to build Vue 3 applications with Element Plus, or customize component styles.
9vue2
Provides comprehensive guidance for Vue 2.x development including Options API, components, directives, lifecycle hooks, computed properties, watchers, Vuex state management, and Vue Router. Use when the user asks about Vue 2, needs to create Vue 2 components, implement reactive data binding, handle component communication, or work with Vue 2 ecosystem tools.
8cypress
Provides comprehensive guidance for Cypress end-to-end testing including commands, assertions, component testing, CI/CD integration, and best practices. Use when the user asks about Cypress, needs to write E2E tests, component tests, or configure Cypress for testing.
8cocos2d-x
Provides comprehensive guidance for Cocos2d-x v4 game engine including scene graph, nodes, sprites, actions, animations, physics, rendering, shaders, and platform deployment. Use when the user asks about Cocos2d-x, needs to create games, implement game features, set up development environments, or deploy games to multiple platforms.
7dalle
Provides comprehensive guidance for DALL-E AI image generation including prompt creation, image generation, variations, and editing. Use when the user asks about DALL-E, needs to generate AI images, create image variations, or work with DALL-E API.
6uniapp-mini-guide
A comprehensive skill for uni-app mini program development. Use when building uni-app mini programs, configuring mini program settings, or working with mini program components and APIs based on the official native support docs.
6