How youzan/vant works
Vant is a Vue component library for mobile web apps, with a large component package and a companion documentation/demo site and ecosystem packages. The main user workflow is to import components and styles into a Vue app, register components, and render them. The graph preserves documented capabilities and major sampled modules; relationships among unsampled component families are omitted rather than inferred.
Main entry points: Field.tsx Field Forms · ImagePreviewItem.tsx Preview Gestures · index.ts Component Utilities · use-expose.ts Public API Exposure
Components 28
Vue UI Library
- Vant Components
packages/vant/src - Cell
packages/vant/src/cell/Cell.tsx - Field Forms
packages/vant/src/field/Field.tsx - Search Field
packages/vant/src/search/Search.tsx - Image
packages/vant/src/image/Image.tsx - Image Preview
packages/vant/src/image-preview/ImagePreview.tsx - Preview Gestures
packages/vant/src/image-preview/ImagePreviewItem.tsx - Uploader Preview
packages/vant/src/uploader/UploaderPreviewItem.tsx - Calendar
packages/vant/src/calendar - Tabs
packages/vant/src/tabs
Shared Runtime
- Component Utilities
packages/vant/src/utils/index.ts - DOM Utilities
packages/vant/src/utils/dom.ts - Format Utilities
packages/vant/src/utils/format.ts - Public API Exposure
packages/vant/src/composables/use-expose.ts - Component IDs
packages/vant/src/composables/use-id.ts
Docs and Demos
- Desktop Docs
packages/vant-cli/site/desktop/App.vue - Docs Layout
packages/vant-cli/site/desktop/components/index.vue - Demo Playground
packages/vant-cli/site/desktop/components/DemoPlayground.vue - Mobile Demos
packages/vant-cli/site/mobile/App.vue - Theme Sync
packages/vant-cli/site/common/iframe-sync.js - Site Locales
packages/vant-cli/site/common/locales.js
Ecosystem Packages
- Area Data
packages/vant-area-data/src/index.ts - Auto Import Resolver
packages/vant-auto-import-resolver/src/index.ts - Compatibility APIs
packages/vant-compat/src - Touch Emulator
packages/vant-touch-emulator/src/index.js
Project Scaffolding
- App Generator
packages/create-vant-cli-app/src/generator.ts
Other components
- Vue Developer
- Vue App
Connections 20
- Vue Developer → Vue App: builds with
- Vue App → Vant Components: imports and registers
- Field Forms → Cell: renders
packages/vant/src/field/Field.tsx - Field Forms → Component IDs: uses
packages/vant/src/field/Field.tsx - Field Forms → Public API Exposure: uses
packages/vant/src/field/Field.tsx - Field Forms → Component Utilities: imports
packages/vant/src/field/Field.tsx - Field Forms → DOM Utilities: imports
packages/vant/src/field/Field.tsx - Search Field → Field Forms: renders
packages/vant/src/search/Search.tsx - Image Preview → Preview Gestures: renders
packages/vant/src/image-preview/ImagePreview.tsx - Image Preview → Public API Exposure: uses
packages/vant/src/image-preview/ImagePreview.tsx - Preview Gestures → Public API Exposure: uses
packages/vant/src/image-preview/ImagePreviewItem.tsx - Preview Gestures → Image: uses
packages/vant/src/image-preview/ImagePreviewItem.tsx - Preview Gestures → Component Utilities: imports
packages/vant/src/image-preview/ImagePreviewItem.tsx - Uploader Preview → Image: renders
packages/vant/src/uploader/UploaderPreviewItem.tsx - Uploader Preview → Component Utilities: imports
packages/vant/src/uploader/UploaderPreviewItem.tsx - Desktop Docs → Docs Layout: renders
packages/vant-cli/site/desktop/App.vue - Desktop Docs → Site Locales: sets language
packages/vant-cli/site/desktop/App.vue - Demo Playground → Theme Sync: integrates
- Mobile Demos → Theme Sync: reads theme
packages/vant-cli/site/mobile/App.vue - Vue Developer → App Generator: creates project