Installation
Recommended package path
- Product teams: use
@varo-ui/clito install owned source; runtime packages remain stable primitives and official wrappers - H5, app, and mini-program targets share the platform-neutral state, event, and controlled-state contracts from
@varo-ui/headless - Mini-program projects use
weapp-vite+wevu+ Tailwind CSS v4 +weapp-tailwindcss
Initialize a project
pnpm dlx create-weapp-vite@latest varo-app
cd varo-app
pnpm installOfficial wrappers
pnpm add vue @varo-ui/h5 @varo-ui/theme
pnpm add vue wevu @varo-ui/weapp @varo-ui/theme
pnpm add @varo-ui/ai # only when the product needs Agent events and MarkdownPrimitives only
pnpm add @varo-ui/headlessshadcn-style install
If you want the shadcn/ui workflow, copy source into the product project first, then wrap it for business needs:
pnpm dlx @varo-ui/cli add --target weapp button select card
pnpm dlx @varo-ui/cli add --target weapp action-sheet collapse dialog list notice-bar popover skeleton steps
pnpm dlx @varo-ui/cli add --target weapp components/agent-ui
pnpm dlx @varo-ui/cli add --target weapp blocks/profile-edit
pnpm dlx @varo-ui/cli add --target h5 button select card components/agent-uiComponents land in src/components/ui/*; blocks land in src/components/blocks/*. Your product can then create UserSelect, DepartmentSelect, and ProductSelect in src/components/biz/*.
The H5 registry covers all 56 runtime component families. The mini-program registry covers 45 high-consensus families. Copy-owned mini-program renderers ship as target-specific native Wevu SFCs that compile directly to WXML/WXSS/JSON; pure adapters may re-export target primitives, and only types, pure functions, and headless primitives are shared across targets.
Agent streaming
@varo-ui/ai is model-provider neutral. A backend emits message.start, text.delta, reasoning.*, tool.*, approval.*, message.end, and done events. H5 can connect Fetch/SSE; a mini program can feed wx.request({ enableChunked: true }) chunks into createAgentSseEventSource().
import { createAgentSseEventSource, createAgentStreamController } from '@varo-ui/ai'
const transport = createAgentSseEventSource()
const controller = createAgentStreamController()
requestTask.onChunkReceived(({ data }) => transport.feed(data))
await controller.connect(transport.source)connect() owns the event-iterator lifecycle: protocol done/error events settle the connection and request iterator cleanup; natural iterator exhaustion synthesizes done.
Mini-program build chain
pnpm add -D weapp-vite weapp-tailwindcss tailwindcss
pnpm add clsx @weapp-tailwindcss/mergeCopy-owned mini-program Registry components use native Wevu SFCs and consume Tailwind v4 utilities through styleIsolation: apply-shared. Rendering and lifecycle code remain target-specific; pure adapters may re-export target primitives, and cross-target sharing is limited to types, pure functions, and headless primitives. The cn() helper uses @weapp-tailwindcss/merge, preserving mini-program escaping behavior.
Engineering notes
- Keep docs, playgrounds, and packages in the monorepo
- Consume published package entries externally; use source aliases only for workspace development
- H5 and mini-program wrappers share primitive naming, while
@varo-ui/h5and@varo-ui/weappown the visual layer
Version strategy
- Use the current compatible toolchain; docs do not pin specific
weapp-vite,wevu, orweapp-tailwindcssversions - Production projects should follow their lockfile, package
peerDependencies, and CI build result - VitePress, Vue, and TypeScript move with the workspace upgrade policy