用途:在 Vue 3.5+ / Nuxt 项目中引入、配置与调试 shadcn-vue 组件。版本为 shadcn-vue@2.8.2,技术栈为 Vue 3.5+、reka-ui ^2.10.1、Tailwind CSS ^4.3.2,组件基座为 reka。
主要能力:CLI 会把组件源码复制进项目并安装其 npm 依赖,复制后的代码归你所有,可自由编辑 components/ui/**;以 -o/--overwrite 重新 add 会覆盖你的改动。支持 init、add、apply、view、search/list、docs、info、diff、migrate、build、mcp init 等命令。
使用方式:用 pnpm dlx shadcn-vue@latest <command>(或 npx、npm exec、bunx)运行。初始化:pnpm dlx shadcn-vue@latest init;添加组件:pnpm dlx shadcn-vue@latest add button card dialog;先用 --dry-run 预览再安装;查看文档:pnpm dlx shadcn-vue@latest docs button。配置文件为项目根的 components.json,关键字段含 style、typescript、tailwind.css、tailwind.baseColor、aliases、iconLibrary、rtl、pointer、menuColor、menuAccent、registries。
限制与注意:条目名解析顺序为 URL、本地文件、@namespace/item、owner/repo/item[#ref]、默认注册表纯名称。2.8.x 预设名无前缀(vega、nova、maia、lyra、mira、luma、sera),旧版 reka-vega 风格名已失效。toast/toaster 已弃用,改用 sonner。图标库当前为 @lucide/vue,lucide-vue-next 为旧包,可运行 migrate icons 迁移。apply <preset> 会重写 UI 组件、字体和 CSS 变量,执行前应先提交代码。注册表地址可用 SHADCN_VUE_URL、REGISTRY_URL 覆盖,默认 https://shadcn-vue.com/r。内置命名空间为 @shadcn,第三方命名空间需在 components.json 的 registries 中配置。可编程 API 从 shadcn-vue、shadcn-vue/registry、shadcn-vue/schema 等子路径导入。其余平台支持与收费信息暂未提供。