ant-design-mobile
When to use this skill
Use this skill whenever the user wants to:
- Build React mobile applications with Ant Design Mobile components
- Use mobile UI components (Button, Form, List, Card, Modal, Tabs, etc.)
- Implement mobile-specific features (pull-to-refresh, infinite scroll, gestures)
- Customize the Ant Design Mobile theme with CSS variables
- Set up internationalization with ConfigProvider
How to use this skill
Workflow
- Install -
npm install antd-mobileand import CSS - Choose components - Match the UI need to the component from the reference below
- Load the example file - Each component has a detailed example in
examples/components/ - Customize theme - Use ConfigProvider or CSS variables for theming
Quick-Start Example: Mobile Form with Validation
import { Button, Form, Input, Toast } from 'antd-mobile';
function LoginForm() {
const [form] = Form.useForm();
const onSubmit = async () => {
const values = await form.validateFields();
Toast.show({ content: `Welcome, ${values.username}!` });
};
return (
<Form form={form} layout="horizontal" footer={
<Button block type="submit" color="primary" onClick={onSubmit}>
Login
</Button>
}>
<Form.Item name="username" label="Username" rules={[{ required: true }]}>
<Input placeholder="Enter username" />
</Form.Item>
<Form.Item name="password" label="Password" rules={[{ required: true }]}>
<Input type="password" placeholder="Enter password" />
</Form.Item>
</Form>
);
}
Component Categories
| Category | Components | Example Files |
|---|---|---|
| Navigation | NavBar, TabBar, Tabs, SideBar | examples/components/nav-bar.md, tabs.md |
| Data Entry | Input, Form, Picker, DatePicker, Switch, Checkbox | examples/components/form.md, picker.md |
| Data Display | List, Card, Badge, Tag, Avatar, Image | examples/components/list.md, card.md |
| Feedback | Modal, Toast, Dialog, ActionSheet, Loading | examples/components/modal.md, toast.md |
| Gestures | PullToRefresh, InfiniteScroll, Swiper | examples/components/pull-to-refresh.md |
API Reference
api/components.md- All component props and APIsapi/config-provider.md- Global configuration and theming
Best Practices
- Import CSS first - Add
import 'antd-mobile/es/global'in your entry file - Wrap with ConfigProvider - Set locale and theme at the app root
- Use CSS variables for theming - Override
--adm-color-primaryetc. for custom branding - Tree-shake imports - Import individual components (
import { Button } from 'antd-mobile') for smaller bundles - Test on real devices - Mobile touch behavior differs from desktop browser emulation
Resources
- Official Website: https://ant-design-mobile.antgroup.com/
- GitHub: https://github.com/ant-design/ant-design-mobile
Keywords
antd-mobile, Ant Design Mobile, React mobile, mobile UI, 移动端, 组件库, Button, Form, List, Modal, Tabs, PullToRefresh, InfiniteScroll, Toast, NavBar, TabBar, mobile components
More from partme-ai/full-stack-skills
vite
Guidance for Vite using the official Guide, Config Reference, and Plugins pages. Use when the user needs Vite setup, configuration, or plugin selection details.
68element-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.
63vue3
Guidance for Vue 3 using the official guide and API reference. Use when the user needs Vue 3 concepts, patterns, or API details to build components, apps, and tooling.
54electron
Build cross-platform desktop applications with Electron, covering main/renderer process architecture, IPC communication, BrowserWindow management, menus, tray icons, packaging, and security best practices. Use when the user asks about Electron, needs to create desktop applications, implement Electron features, or build cross-platform desktop apps.
51uniapp-project
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
40ascii-cli-logo-banner
Entry point for ASCII CLI banners that routes to the Python built-in font skill or figlet.js/FIGfont skill. Use when the user wants a startup banner, ASCII logo, terminal welcome screen, or CLI branding for a service.
38