mcpField
V
vant-ui-skills

vant-ui-skills

github.com/jiaiyanDevelopment040 installsUpdated 32w ago
Repository

About vant-ui-skills

vant-ui-skills is a skill library that helps AI agents work with Vant mobile UI components. It organizes component, Vue 3 composable, and setup guidance for developers building mobile web or hybrid apps.

Key features

  1. 01Guidance for Vant components
  2. 02Skills for forms, actions, display, and navigation
  3. 03Vue 3 composable guidance
  4. 04Setup, theming, and i18n skills
  5. 05Component API and usage examples

Use cases

  1. 01Implement a Vant component in a mobile app
  2. 02Configure Vant or customize its theme
  3. 03Add internationalization to a Vant project
  4. 04Resolve issues with Vant components

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jiaiyan/vant-ui-skills --skill vant-ui-skills

After installing, type/vant-ui-skillsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

LICENSE
README.md
README_CN.md
AGENTS.md

Details

From the project README

Vant Skills Library

A comprehensive skill library for Vant UI framework, designed for AI agents to understand and utilize Vant mobile components effectively.

When to Invoke

Invoke this skill when:

  • User needs to implement any Vant component
  • User asks about Vant configuration or setup
  • User wants to customize themes for mobile apps
  • User needs internationalization (i18n) support
  • User asks about mobile-first design patterns
  • User encounters issues with Vant components
  • User is building mobile web applications or hybrid apps

Skill Library Overview

Vant is a lightweight, reliable mobile component library. This library contains 102 skills organized into the following categories:

CategoryCountDescriptionPath Pattern
Basic Components10Essential UI components./components/van-{name}/SKILL.md
Form Components19Form input and validation./components/van-{name}/SKILL.md
Action Components12User interaction components./components/van-{name}/SKILL.md
Display Components26Data display components./components/van-{name}/SKILL.md
Navigation Components10Navigation and routing./components/van-{name}/SKILL.md
Business Components9Business-specific components./components/van-{name}/SKILL.md
Composables11Vue 3 composition API utilities./composables/use-{name}/SKILL.md
Foundation Skills5Core setup and configuration./vant-{name}/SKILL.md

How to Locate Skills

1. Component Skills (86 skills)

All component skills follow the naming convention van-{component-name} and are located in the components/ directory.

Path Pattern:

./components/van-{component-name}/SKILL.md

Examples:

  • Button: ./components/van-button/SKILL.md
  • Form: ./components/van-form/SKILL.md
  • List: ./components/van-list/SKILL.md
  • Popup: ./components/van-popup/SKILL.md
2. Composables Skills (11 skills)

Composables provide Vue 3 composition API utilities for common mobile patterns.

Path Pattern:

./composables/use-{name}/SKILL.md

Examples:

  • useCountDown: ./composables/use-count-down/SKILL.md
  • useLazyRender: ./composables/use-lazy-render/SKILL.md
  • useRect: ./composables/use-rect/SKILL.md
3. Foundation Skills (6 skills)

Foundation skills cover core setup and configuration.

Skill NamePathDescription
Quickstart./vant-quickstart/SKILL.mdInstallation and setup
Theming./vant-theming/SKILL.mdTheme customization
i18n./vant-i18n/SKILL.mdInternationalization
Advanced Usage./vant-advanced-usage/SKILL.mdAdvanced patterns
Components./vant-components/SKILL.mdComponent overview index
Composables./vant-composables/SKILL.mdComposables overview index

Skill Invocation Guide

Step 1: Identify User Intent

Analyze the user's request to determine which skill category is needed:

User Request PatternSkill CategoryExample Skill
"Create a button/form/list..."Componentvan-button, van-form, van-list
"How to set up Vant"Foundationvant-quickstart
"Customize theme colors"Foundationvant-theming
"Add multi-language support"Foundationvant-i18n
"Use countdown timer"Composableuse-count-down
"Implement lazy loading"Composableuse-lazy-render
Step 2: Locate the Skill File

Use the path patterns above to locate the appropriate skill file:

# For component skills
./components/van-{component-name}/SKILL.md

# For composables skills
./composables/use-{name}/SKILL.md

# For foundation skills
./vant-{name}/SKILL.md
Step 3: Read and Apply Skill Content

Each skill file contains:

  • When to Invoke: Specific conditions for using the skill
  • Features: Component capabilities and options
  • API Reference: Attributes, events, slots, exposes
  • Usage Examples: Code snippets for common patterns
  • Best Practices: Recommended implementation guidelines

Component Skill Index

Basic Components (10)
ComponentSkill PathDescription
Button./components/van-button/SKILL.mdButtons
Cell./components/van-cell/SKILL.mdCell items
CellGroup./components/van-cell-group/SKILL.mdCell groups
ConfigProvider./components/van-config-provider/SKILL.mdGlobal config
Icon./components/van-icon/SKILL.mdIcons
Image./components/van-image/SKILL.mdImages
Layout./components/van-layout/SKILL.mdLayout system
Popup./components/van-popup/SKILL.mdPopup overlay
Toast./components/van-toast/SKILL.mdToast messages
Transition./components/van-transition/SKILL.mdTransitions
Form Components (19)
ComponentSkill PathDescription
AddressEdit./components/van-address-edit/SKILL.mdAddress editor
AddressList./components/van-address-list/SKILL.mdAddress list
Area./components/van-area/SKILL.mdArea picker
Calendar./components/van-calendar/SKILL.mdCalendar
Cascader./components/van-cascader/SKILL.mdCascading selection
Checkbox./components/van-checkbox/SKILL.mdCheckboxes
ContactCard./components/van-contact-card/SKILL.mdContact card
ContactEdit./components/van-contact-edit/SKILL.mdContact editor
ContactList./components/van-contact-list/SKILL.mdContact list
DatePicker./components/van-date-picker/SKILL.mdDate picker
Field./components/van-field/SKILL.mdInput fields
Form./components/van-form/SKILL.mdForm management
NumberKeyboard./components/van-number-keyboard/SKILL.mdNumber keyboard
PasswordInput./components/van-password-input/SKILL.mdPassword input
Picker./components/van-picker/SKILL.mdPicker
Radio./components/van-radio/SKILL.mdRadio buttons
Rate./components/van-rate/SKILL.mdStar rating
Search./components/van-search/SKILL.mdSearch bar
Slider./components/van-slider/SKILL.mdSlider
Stepper./components/van-stepper/SKILL.mdStepper
Switch./components/van-switch/SKILL.mdToggle switch
TimePicker./components/van-time-picker/SKILL.mdTime picker
Uploader./components/van-uploader/SKILL.mdFile uploader
Action Components (12)
ComponentSkill PathDescription
ActionSheet./components/van-action-sheet/SKILL.mdAction sheet
Dialog./components/van-dialog/SKILL.mdDialog modal
DropdownMenu./components/van-dropdown-menu/SKILL.mdDropdown menu
FloatingBubble./components/van-floating-bubble/SKILL.mdFloating bubble
FloatingPanel./components/van-floating-panel/SKILL.mdFloating panel
Loading./components/van-loading/SKILL.mdLoading indicator
Notify./components/van-notify/SKILL.mdNotification
Overlay./components/van-overlay/SKILL.mdOverlay
PickerGroup./components/van-picker-group/SKILL.mdPicker group
PullRefresh./components/van-pull-refresh/SKILL.mdPull to refresh
ShareSheet./components/van-share-sheet/SKILL.mdShare sheet
SwipeCell./components/van-swipe-cell/SKILL.mdSwipe cell
Display Components (26)
ComponentSkill PathDescription
Badge./components/van-badge/SKILL.mdBadge
Collapse./components/van-collapse/SKILL.mdCollapse
CountDown./components/van-count-down/SKILL.mdCountdown
Divider./components/van-divider/SKILL.mdDivider
Empty./components/van-empty/SKILL.mdEmpty state
Grid./components/van-grid/SKILL.mdGrid
ImagePreview./components/van-image-preview/SKILL.mdImage preview
Lazyload./components/van-lazyload/SKILL.mdLazy loading
List./components/van-list/SKILL.mdInfinite list
Loading./components/van-loading/SKILL.mdLoading
Marquee./components/van-marquee/SKILL.mdMarquee
NoticeBar./components/van-notice-bar/SKILL.mdNotice bar
Pagination./components/van-pagination/SKILL.mdPagination
PasswordInput./components/van-password-input/SKILL.mdPassword input
Picker./components/van-picker/SKILL.mdPicker
Progress./components/van-progress/SKILL.mdProgress bar
RollingText./components/van-rolling-text/SKILL.mdRolling text
Skeleton./components/van-skeleton/SKILL.mdSkeleton
Slider./components/van-slider/SKILL.mdSlider
Step./components/van-step/SKILL.mdSteps
Sticky./components/van-sticky/SKILL.mdSticky positioning
Swipe./components/van-swipe/SKILL.mdSwipe carousel
Tag./components/van-tag/SKILL.mdTag
TextEllipsis./components/van-text-ellipsis/SKILL.mdText ellipsis
TreeSelect./components/van-tree-select/SKILL.mdTree select
Watermark./components/van-watermark/SKILL.mdWatermark
Navigation Components (10)
ComponentSkill PathDescription
BackTop./components/van-back-top/SKILL.mdBack to top
Grid./components/van-grid/SKILL.mdGrid navigation
IndexBar./components/van-index-bar/SKILL.mdIndex bar
NavBar./components/van-nav-bar/SKILL.mdNavigation bar
Pagination./components/van-pagination/SKILL.mdPagination
Sidebar./components/van-sidebar/SKILL.mdSidebar
Tab./components/van-tab/SKILL.mdTabs
Tabbar./components/van-tabbar/SKILL.mdTab bar
TreeSelect./components/van-tree-select/SKILL.mdTree select
Business Components (9)
ComponentSkill PathDescription
AddressEdit./components/van-address-edit/SKILL.mdAddress editor
AddressList./components/van-address-list/SKILL.mdAddress list
Area./components/van-area/SKILL.mdArea picker
Card./components/van-card/SKILL.mdCard
ContactCard./components/van-contact-card/SKILL.mdContact card
ContactEdit./components/van-contact-edit/SKILL.mdContact editor
ContactList./components/van-contact-list/SKILL.mdContact list
Coupon./components/van-coupon/SKILL.mdCoupon
SubmitBar./components/van-submit-bar/SKILL.mdSubmit bar

Composables Index (11)

ComposableSkill PathDescription
useCountDown./composables/use-count-down/SKILL.mdCountdown timer
useCustomFieldValue./composables/use-custom-field-value/SKILL.mdCustom field value
useEventListener./composables/use-event-listener/SKILL.mdEvent listener
useId./composables/use-id/SKILL.mdUnique ID generator
useLazyRender./composables/use-lazy-render/SKILL.mdLazy rendering
usePageVisibility./composables/use-page-visibility/SKILL.mdPage visibility
useRect./composables/use-rect/SKILL.mdElement rect
useRelation./composables/use-relation/SKILL.mdComponent relation
useResetState./composables/use-reset-state/SKILL.mdReset state
useRtl./composables/use-rtl/SKILL.mdRTL support
useWindowSize./composables/use-window-size/SKILL.mdWindow size

Usage Examples

Example 1: User asks about button implementation

User Request: "How do I create a primary button with loading state?"

Agent Action:

  1. Identify intent: Component skill - Button
  2. Locate skill: ./components/van-button/SKILL.md
  3. Read skill content
  4. Provide response with API reference and code example

Response:

<template>
  <van-button type="primary" :loading="loading" @click="handleClick">
    {{ loading ? 'Loading...' : 'Submit' }}
  </van-button>
</template>

<script setup>
import { ref } from 'vue'

const loading = ref(false)

const handleClick = async () => {
  loading.value = true
  try {
    await submitData()
  } finally {
    loading.value = false
  }
}
</script>
Example 2: User asks about form validation

User Request: "How do I create a form with validation?"

Agent Action:

  1. Identify intent: Component skill - Form
  2. Locate skill: ./components/van-form/SKILL.md
  3. Read skill content
  4. Provide response with validation example

Response:

<template>
  <van-form @submit="onSubmit">
    <van-field
      v-model="username"
      name="username"
      label="Username"
      placeholder="Username"
      :rules="[{ required: true, message: 'Please input username' }]"
    />
    <van-field
      v-model="password"
      type="password"
      name="password"
      label="Password"
      placeholder="Password"
      :rules="[{ required: true, message: 'Please input password' }]"
    />
    <div style="margin: 16px;">
      <van-button round block type="primary" native-type="submit">
        Submit
      </van-button>
    </div>
  </van-form>
</template>

<script setup>
import { ref } from 'vue'

const username = ref('')
const password = ref('')

const onSubmit = (values) => {
  console.log('submit', values)
}
</script>
Example 3: User asks about infinite list

User Request: "How do I implement an infinite scroll list?"

Agent Action:

  1. Identify intent: Component skill - List
  2. Locate skill: ./components/van-list/SKILL.md
  3. Read skill content
  4. Provide response with list example

Response:

<template>
  <van-list
    v-model:loading="loading"
    :finished="finished"
    finished-text="No more data"
    @load="onLoad"
  >
    <van-cell v-for="item in list" :key="item" :title="item" />
  </van-list>
</template>

<script setup>
import { ref } from 'vue'

const list = ref([])
const loading = ref(false)
const finished = ref(false)

const onLoad = () => {
  setTimeout(() => {
    for (let i = 0; i < 10; i++) {
      list.value.push(list.value.length + 1)
    }
    loading.value = false
    
    if (list.value.length >= 40) {
      finished.value = true
    }
  }, 1000)
}
</script>
Example 4: User asks about countdown timer

User Request: "How do I implement a countdown timer?"

Agent Action:

  1. Identify intent: Composable skill - useCountDown
  2. Locate skill: ./composables/use-count-down/SKILL.md
  3. Read skill content
  4. Provide response with composable example

Response:

<template>
  <van-count-down :time="time" />
</template>

<script setup>
import { useCountDown } from '@vant/use'

const countDown = useCountDown({
  time: 24 * 60 * 60 * 1000,
  autostart: true,
})

const time = countDown.current
</script>
Example 5: User asks about theme customization

User Request: "How do I customize Vant theme colors?"

Agent Action:

  1. Identify intent: Foundation skill - Theming
  2. Locate skill: ./vant-theming/SKILL.md
  3. Read skill content
  4. Provide response with CSS variables example

Response:

:root {
  --van-primary-color: #1989fa;
  --van-success-color: #07c160;
  --van-danger-color: #ee0a24;
  --van-warning-color: #ff976a;
  --van-info-color: #1989fa;
}

Configuration Requirements

Prerequisites

Before using this skill library, ensure:

  1. Vue 3.3+ is installed
  2. Vant 4+ is installed
  3. Node.js 18+ for development
Installation
npm install vant
TypeScript Support

Add to tsconfig.json:

{
  "compilerOptions": {
    "types": ["vant/global"]
  }
}
Import Styles
import 'vant/lib/index.css'
On-Demand Import (Recommended)
import { Button, Cell, Form } from 'vant'

Input Parameters

When invoking skills, consider these parameters:

ParameterTypeDescriptionRequired
componentstringComponent name (e.g., "button", "form")Yes
featurestringSpecific feature needed (e.g., "validation", "loading")No
contextobjectAdditional context (framework, TypeScript usage)No

Output Format

Each skill provides:

  1. API Reference: Complete attributes, events, slots, exposes
  2. Code Examples: Working code snippets
  3. Best Practices: Recommended implementation patterns
  4. Common Issues: Troubleshooting tips
  5. Component Interactions: How to use with other components

Important Notes

1. Skill Priority

When multiple skills could apply, prioritize in this order:

  1. Component-specific skills (most specific)
  2. Composable skills (composition API utilities)
  3. Foundation skills (configuration)
2. Cross-References

Many skills reference related skills. Always check:

  • Related components in the same category
  • Foundation skills for configuration
  • Composables for common patterns
3. Version Compatibility

This skill library is based on Vant 4+. Some features may not be available in earlier versions.

4. Naming Conventions
  • Component skills use van-{name} format (matches Vue component tags)
  • Composables use use-{name} format (matches Vue composition API naming)
  • Foundation skills use vant-{name} format
5. File Structure
vant-skills/
├── SKILL.md                          # This file (main entry)
├── README.md                         # English documentation
├── README_CN.md                      # Chinese documentation
├── AGENTS.md                         # Agents documentation
├── components/                       # 86 component skills
│   ├── van-button/
│   │   └── SKILL.md
│   ├── van-form/
│   │   └── SKILL.md
│   └── ...
├── composables/                      # 11 composable skills
│   ├── use-count-down/
│   │   └── SKILL.md
│   ├── use-lazy-render/
│   │   └── SKILL.md
│   └── ...
├── vant-quickstart/                  # Foundation skills
├── vant-theming/
├── vant-i18n/
├── vant-advanced-usage/
└── vant-components/
6. Mobile-First Design

Vant is designed for mobile devices. Key considerations:

  • Touch-friendly interactions
  • Responsive layouts
  • Performance optimization for mobile
  • Native-like UI patterns

Best Practices for Agents

  1. Always start with this file when user mentions Vant
  2. Locate the specific skill based on user intent
  3. Read the complete skill file before responding
  4. Provide code examples from the skill documentation
  5. Reference related skills when applicable
  6. Include best practices from the skill content
  7. Mention common issues if relevant to user's context
  8. Consider mobile-first patterns in all recommendations

Related Resources

Comments

Markdown supported