ant-design-vue-module-guideline
Skill: ant-design-vue-module-guideline
Purpose
Ensure generated frontend modules use Ant Design Vue consistently and appropriately.
This skill is intended for:
- module pages
- module components
- form pages
- list pages
- CRUD-oriented enterprise UI
Project UI Assumption
This project uses:
- Vue 3
- TypeScript
- Pinia
- Vue Router
- Ant Design Vue
Ant Design Vue is the primary UI component library.
Default UI Rule
Use Ant Design Vue by default for standard business UI:
- Button
- Form
- Form.Item
- Input
- Input.Search
- InputNumber
- Select
- Radio
- Checkbox
- Switch
- DatePicker
- Table
- Tag
- Card
- Tabs
- Modal
- Drawer
- Pagination
- Breadcrumb
- Dropdown
- Menu
- Spin
- Empty
- Result
- Alert
- message
- notification
Do not build custom replacements for these unless there is a strong reason.
List Page Rule
For list pages, prefer:
a-cardor clean page container- filter/search toolbar using Ant Design Vue form controls
a-tablefor tabular dataa-paginationif needed separatelya-tagfor statusesa-buttonfor actions
The page should remain readable and enterprise-style.
Form Page Rule
For create/edit forms, prefer:
a-forma-form-itema-inputa-selecta-switcha-checkboxa-radio-groupa-date-pickera-input-numbera-uploadwhen needed
Avoid building manual HTML form systems when Ant Design Vue already solves the problem.
Detail / Overlay Rule
For detail panels or editing overlays, prefer:
a-modala-drawera-descriptionsa-card
Choose based on use case:
- Modal -> quick edit / confirmation
- Drawer -> medium-complexity edit/detail flow
- Dedicated page -> large business workflow
Feedback Rule
Use Ant Design Vue feedback patterns:
messagefor lightweight operation feedbacknotificationfor more visible async feedbacka-alertfor inline warning/error/infoa-resultfor empty/error/success pagesa-spinfor loading statesa-emptyfor no-data states
Styling Rule
- Prefer Ant Design Vue defaults
- Keep custom CSS minimal
- Do not over-style components unnecessarily
- Focus on consistency, spacing, and clarity
- Avoid mixing multiple visual systems
Shared Component Rule
Only create wrappers in frontend/src/shared/components/ when:
- the same Ant Design Vue pattern is reused multiple times
- there is a clear app-wide convention
- the wrapper simplifies usage instead of hiding everything
Good examples:
BaseTableBasePageHeaderBaseStatusTag
Bad examples:
- wrapping every Ant Design Vue component without adding value
Module Boundary Rule
Business-specific UI stays inside:
frontend/src/modules/<module_name>/components/
Generic reusable UI stays inside:
frontend/src/shared/components/
Do not move module UI into shared too early.
Form Validation Rule
Use frontend validation consistent with:
- Ant Design Vue Form rules
- backend validation rules
- OpenAPI constraints where practical
Do not let frontend validation drift away from backend expectations.
Tables and Pagination Rule
For API list pages:
- represent tabular data with
a-table - wire pagination cleanly
- align filter/sort fields with API query params
- keep status/actions visually clear
Forbidden Patterns
- introducing another primary UI library
- replacing standard Ant Design Vue components with raw custom HTML unnecessarily
- building inconsistent CRUD pages across modules
- excessive custom CSS that breaks Ant Design Vue consistency
- creating fake shared wrappers that add no value
Final Goal
Frontend UI should be:
- consistent
- enterprise-friendly
- Ant Design Vue-based
- maintainable
- easy to extend across modules
