[{"data":1,"prerenderedAt":773},["ShallowReactive",2],{"navigation":3,"$fMW9jOOkNpZriWVK3P_bZYNOyYR2IEPvrHsC7cDBlJJc":405,"/docs/installation/nuxt":418,"surround-/docs/installation/nuxt":770},[4],{"title":5,"path":6,"stem":7,"children":8,"page":17},"Docs","/docs","docs",[9,90,353,360,366,379],{"path":6,"stem":7,"title":10,"type":11,"children":12},"Get Started","group",[13,19,44,48,52,70,74,78,82,86],{"title":14,"path":15,"stem":16,"new":17,"type":18,"children":-1},"Introduction","/docs/introduction","docs/01.introduction",false,"page",{"title":20,"path":21,"stem":22,"children":23,"new":17,"type":11},"Installation","/docs/installation","docs/02.installation",[24,28,32,36,40],{"title":25,"path":26,"stem":27,"new":17,"type":18,"children":-1},"Vite","/docs/installation/vite","docs/installation/01.vite",{"title":29,"path":30,"stem":31,"new":17,"type":18,"children":-1},"Nuxt","/docs/installation/nuxt","docs/installation/02.nuxt",{"title":33,"path":34,"stem":35,"new":17,"type":18,"children":-1},"Astro","/docs/installation/astro","docs/installation/03.astro",{"title":37,"path":38,"stem":39,"new":17,"type":18,"children":-1},"Laravel","/docs/installation/laravel","docs/installation/04.laravel",{"title":41,"path":42,"stem":43,"new":17,"type":18,"children":-1},"Manual Installation","/docs/installation/manual","docs/installation/05.manual",{"title":45,"path":46,"stem":47,"new":17,"type":18,"children":-1},"components.json","/docs/components-json","docs/03.components-json",{"title":49,"path":50,"stem":51,"new":17,"type":18,"children":-1},"Theming","/docs/theming","docs/04.theming",{"title":53,"path":54,"stem":55,"children":56,"new":17,"type":11},"Dark Mode","/docs/dark-mode","docs/05.dark-mode",[57,60,63,67],{"title":25,"path":58,"stem":59,"new":17,"type":18,"children":-1},"/docs/dark-mode/vite","docs/dark-mode/01.vite",{"title":29,"path":61,"stem":62,"new":17,"type":18,"children":-1},"/docs/dark-mode/nuxt","docs/dark-mode/02.nuxt",{"title":64,"path":65,"stem":66,"new":17,"type":18,"children":-1},"Vitepress","/docs/dark-mode/vitepress","docs/dark-mode/03.vitepress",{"title":33,"path":68,"stem":69,"new":17,"type":18,"children":-1},"/docs/dark-mode/astro","docs/dark-mode/04.astro",{"title":71,"path":72,"stem":73,"new":17,"type":18,"children":-1},"CLI","/docs/cli","docs/06.cli",{"title":75,"path":76,"stem":77,"new":17,"type":18,"children":-1},"JavaScript","/docs/javascript","docs/07.javascript",{"title":79,"path":80,"stem":81,"new":17,"type":18,"children":-1},"Figma","/docs/figma","docs/09.figma",{"title":83,"path":84,"stem":85,"new":17,"type":18,"children":-1},"Changelog","/docs/changelog","docs/10.changelog",{"title":87,"path":88,"stem":89,"new":17,"type":18,"children":-1},"Legacy Docs","/docs/legacy","docs/11.legacy",{"title":91,"path":92,"stem":93,"children":94,"new":17,"type":11},"Components","/docs/components","docs/02.components",[95,100,104,108,112,116,120,124,128,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,233,237,241,245,249,253,257,261,265,269,273,277,281,285,289,293,297,301,305,309,313,317,321,325,329,333,337,341,345,349],{"title":96,"path":97,"stem":98,"new":17,"type":99,"children":-1},"Accordion","/docs/components/accordion","docs/components/accordion","component",{"title":101,"path":102,"stem":103,"new":17,"type":99,"children":-1},"Alert","/docs/components/alert","docs/components/alert",{"title":105,"path":106,"stem":107,"new":17,"type":99,"children":-1},"Alert Dialog","/docs/components/alert-dialog","docs/components/alert-dialog",{"title":109,"path":110,"stem":111,"new":17,"type":99,"children":-1},"Aspect Ratio","/docs/components/aspect-ratio","docs/components/aspect-ratio",{"title":113,"path":114,"stem":115,"new":17,"type":99,"children":-1},"Avatar","/docs/components/avatar","docs/components/avatar",{"title":117,"path":118,"stem":119,"new":17,"type":99,"children":-1},"Badge","/docs/components/badge","docs/components/badge",{"title":121,"path":122,"stem":123,"new":17,"type":99,"children":-1},"Breadcrumb","/docs/components/breadcrumb","docs/components/breadcrumb",{"title":125,"path":126,"stem":127,"new":17,"type":99,"children":-1},"Button","/docs/components/button","docs/components/button",{"title":129,"path":130,"stem":131,"new":132,"type":99,"children":-1},"Button Group","/docs/components/button-group","docs/components/button-group",true,{"title":134,"path":135,"stem":136,"new":17,"type":99,"children":-1},"Calendar","/docs/components/calendar","docs/components/calendar",{"title":138,"path":139,"stem":140,"new":17,"type":99,"children":-1},"Card","/docs/components/card","docs/components/card",{"title":142,"path":143,"stem":144,"new":17,"type":99,"children":-1},"Carousel","/docs/components/carousel","docs/components/carousel",{"title":146,"path":147,"stem":148,"new":17,"type":99,"children":-1},"Chart","/docs/components/chart","docs/components/chart",{"title":150,"path":151,"stem":152,"new":17,"type":99,"children":-1},"Checkbox","/docs/components/checkbox","docs/components/checkbox",{"title":154,"path":155,"stem":156,"new":17,"type":99,"children":-1},"Collapsible","/docs/components/collapsible","docs/components/collapsible",{"title":158,"path":159,"stem":160,"new":17,"type":99,"children":-1},"Combobox","/docs/components/combobox","docs/components/combobox",{"title":162,"path":163,"stem":164,"new":17,"type":99,"children":-1},"Command","/docs/components/command","docs/components/command",{"title":166,"path":167,"stem":168,"new":17,"type":99,"children":-1},"Context Menu","/docs/components/context-menu","docs/components/context-menu",{"title":170,"path":171,"stem":172,"new":17,"type":99,"children":-1},"Data Table","/docs/components/data-table","docs/components/data-table",{"title":174,"path":175,"stem":176,"new":17,"type":99,"children":-1},"Date Picker","/docs/components/date-picker","docs/components/date-picker",{"title":178,"path":179,"stem":180,"new":17,"type":99,"children":-1},"Dialog","/docs/components/dialog","docs/components/dialog",{"title":182,"path":183,"stem":184,"new":17,"type":99,"children":-1},"Drawer","/docs/components/drawer","docs/components/drawer",{"title":186,"path":187,"stem":188,"new":17,"type":99,"children":-1},"Dropdown Menu","/docs/components/dropdown-menu","docs/components/dropdown-menu",{"title":190,"path":191,"stem":192,"new":132,"type":99,"children":-1},"Empty","/docs/components/empty","docs/components/empty",{"title":194,"path":195,"stem":196,"new":132,"type":99,"children":-1},"Field","/docs/components/field","docs/components/field",{"title":198,"path":199,"stem":200,"new":17,"type":99,"children":-1},"Form","/docs/components/form","docs/components/form",{"title":202,"path":203,"stem":204,"new":17,"type":99,"children":-1},"Hover Card","/docs/components/hover-card","docs/components/hover-card",{"title":206,"path":207,"stem":208,"new":17,"type":99,"children":-1},"Input","/docs/components/input","docs/components/input",{"title":210,"path":211,"stem":212,"new":132,"type":99,"children":-1},"Input Group","/docs/components/input-group","docs/components/input-group",{"title":214,"path":215,"stem":216,"new":17,"type":99,"children":-1},"Input OTP","/docs/components/input-otp","docs/components/input-otp",{"title":218,"path":219,"stem":220,"new":132,"type":99,"children":-1},"Item","/docs/components/item","docs/components/item",{"title":222,"path":223,"stem":224,"new":132,"type":99,"children":-1},"Kbd","/docs/components/kbd","docs/components/kbd",{"title":226,"path":227,"stem":228,"new":17,"type":99,"children":-1},"Label","/docs/components/label","docs/components/label",{"title":230,"path":231,"stem":232,"new":17,"type":99,"children":-1},"Menubar","/docs/components/menubar","docs/components/menubar",{"title":234,"path":235,"stem":236,"new":132,"type":99,"children":-1},"Native Select","/docs/components/native-select","docs/components/native-select",{"title":238,"path":239,"stem":240,"new":17,"type":99,"children":-1},"Navigation Menu","/docs/components/navigation-menu","docs/components/navigation-menu",{"title":242,"path":243,"stem":244,"new":17,"type":99,"children":-1},"Number Field","/docs/components/number-field","docs/components/number-field",{"title":246,"path":247,"stem":248,"new":17,"type":99,"children":-1},"Pagination","/docs/components/pagination","docs/components/pagination",{"title":250,"path":251,"stem":252,"new":17,"type":99,"children":-1},"Pin Input","/docs/components/pin-input","docs/components/pin-input",{"title":254,"path":255,"stem":256,"new":17,"type":99,"children":-1},"Popover","/docs/components/popover","docs/components/popover",{"title":258,"path":259,"stem":260,"new":17,"type":99,"children":-1},"Progress","/docs/components/progress","docs/components/progress",{"title":262,"path":263,"stem":264,"new":17,"type":99,"children":-1},"Radio Group","/docs/components/radio-group","docs/components/radio-group",{"title":266,"path":267,"stem":268,"new":17,"type":99,"children":-1},"Range Calendar","/docs/components/range-calendar","docs/components/range-calendar",{"title":270,"path":271,"stem":272,"new":17,"type":99,"children":-1},"Resizable","/docs/components/resizable","docs/components/resizable",{"title":274,"path":275,"stem":276,"new":17,"type":99,"children":-1},"Scroll Area","/docs/components/scroll-area","docs/components/scroll-area",{"title":278,"path":279,"stem":280,"new":17,"type":99,"children":-1},"Select","/docs/components/select","docs/components/select",{"title":282,"path":283,"stem":284,"new":17,"type":99,"children":-1},"Separator","/docs/components/separator","docs/components/separator",{"title":286,"path":287,"stem":288,"new":17,"type":99,"children":-1},"Sheet","/docs/components/sheet","docs/components/sheet",{"title":290,"path":291,"stem":292,"new":17,"type":99,"children":-1},"Sidebar","/docs/components/sidebar","docs/components/sidebar",{"title":294,"path":295,"stem":296,"new":17,"type":99,"children":-1},"Skeleton","/docs/components/skeleton","docs/components/skeleton",{"title":298,"path":299,"stem":300,"new":17,"type":99,"children":-1},"Slider","/docs/components/slider","docs/components/slider",{"title":302,"path":303,"stem":304,"new":17,"type":99,"children":-1},"Sonner","/docs/components/sonner","docs/components/sonner",{"title":306,"path":307,"stem":308,"new":132,"type":99,"children":-1},"Spinner","/docs/components/spinner","docs/components/spinner",{"title":310,"path":311,"stem":312,"new":17,"type":99,"children":-1},"Stepper","/docs/components/stepper","docs/components/stepper",{"title":314,"path":315,"stem":316,"new":17,"type":99,"children":-1},"Switch","/docs/components/switch","docs/components/switch",{"title":318,"path":319,"stem":320,"new":17,"type":99,"children":-1},"Table","/docs/components/table","docs/components/table",{"title":322,"path":323,"stem":324,"new":17,"type":99,"children":-1},"Tabs","/docs/components/tabs","docs/components/tabs",{"title":326,"path":327,"stem":328,"new":17,"type":99,"children":-1},"Tags Input","/docs/components/tags-input","docs/components/tags-input",{"title":330,"path":331,"stem":332,"new":17,"type":99,"children":-1},"Textarea","/docs/components/textarea","docs/components/textarea",{"title":334,"path":335,"stem":336,"new":17,"type":99,"children":-1},"Toast","/docs/components/toast","docs/components/toast",{"title":338,"path":339,"stem":340,"new":17,"type":99,"children":-1},"Toggle","/docs/components/toggle","docs/components/toggle",{"title":342,"path":343,"stem":344,"new":17,"type":99,"children":-1},"Toggle Group","/docs/components/toggle-group","docs/components/toggle-group",{"title":346,"path":347,"stem":348,"new":17,"type":99,"children":-1},"Tooltip","/docs/components/tooltip","docs/components/tooltip",{"title":350,"path":351,"stem":352,"new":17,"type":99,"children":-1},"Typography","/docs/components/typography","docs/components/typography",{"title":20,"path":21,"stem":22,"children":354,"new":17,"type":11},[355,356,357,358,359],{"title":25,"path":26,"stem":27,"new":17,"type":18,"children":-1},{"title":29,"path":30,"stem":31,"new":17,"type":18,"children":-1},{"title":33,"path":34,"stem":35,"new":17,"type":18,"children":-1},{"title":37,"path":38,"stem":39,"new":17,"type":18,"children":-1},{"title":41,"path":42,"stem":43,"new":17,"type":18,"children":-1},{"title":53,"path":54,"stem":55,"children":361,"new":17,"type":11},[362,363,364,365],{"title":25,"path":58,"stem":59,"new":17,"type":18,"children":-1},{"title":29,"path":61,"stem":62,"new":17,"type":18,"children":-1},{"title":64,"path":65,"stem":66,"new":17,"type":18,"children":-1},{"title":33,"path":68,"stem":69,"new":17,"type":18,"children":-1},{"title":367,"path":368,"stem":369,"children":370,"new":17,"type":11},"Forms","/docs/forms","docs/forms",[371,375],{"title":372,"path":373,"stem":374,"new":17,"type":18,"children":-1},"VeeValidate","/docs/forms/vee-validate","docs/forms/01.vee-validate",{"title":376,"path":377,"stem":378,"new":17,"type":18,"children":-1},"TanStack Form","/docs/forms/tanstack-form","docs/forms/02.tanstack-form",{"title":380,"path":381,"stem":382,"children":383,"new":17,"type":11},"Registry","/docs/registry","docs/registry/index",[384,385,389,393,397,401],{"title":380,"path":381,"stem":382,"new":17,"type":18,"children":-1},{"title":386,"path":387,"stem":388,"new":17,"type":18,"children":-1},"Examples","/docs/registry/examples","docs/registry/examples",{"title":390,"path":391,"stem":392,"new":17,"type":18,"children":-1},"FAQ","/docs/registry/faq","docs/registry/faq",{"title":394,"path":395,"stem":396,"new":17,"type":18,"children":-1},"Getting Started","/docs/registry/getting-started","docs/registry/getting-started",{"title":398,"path":399,"stem":400,"new":17,"type":18,"children":-1},"registry-item.json","/docs/registry/registry-item-json","docs/registry/registry-item-json",{"title":402,"path":403,"stem":404,"new":17,"type":18,"children":-1},"registry.json","/docs/registry/registry-json","docs/registry/registry-json",{"repo":406},{"id":407,"name":408,"repo":409,"description":410,"createdAt":411,"updatedAt":412,"pushedAt":413,"stars":414,"watchers":415,"forks":416,"defaultBranch":417},658791894,"shadcn-vue","unovue/shadcn-vue","Vue port of shadcn-ui","2023-06-26T13:53:23Z","2026-04-06T17:33:41Z","2026-04-06T17:33:39Z",9706,37,634,"dev",{"id":419,"title":29,"body":420,"description":763,"extension":764,"links":765,"meta":766,"navigation":132,"new":17,"path":30,"rawbody":767,"seo":768,"stem":31,"__hash__":769},"content/docs/installation/02.nuxt.md",{"type":421,"value":422,"toc":750},"minimark",[423],[424,425,426,431,440,450,476,480,483,568,575,578,633,639,645,649,652,658,668,674,678,685,691,695,701,707,712,720,724,727,733,739],"steps",{},[427,428,430],"h3",{"id":429},"create-project","Create project",[432,433,434,435,439],"p",{},"Start by creating a new Nuxt project using ",[436,437,438],"code",{},"create-nuxt-app",":",[441,442,448],"pre",{"className":443,"code":445,"language":446,"meta":447},[444],"language-bash","npm create nuxt@latest\n","bash","",[436,449,445],{"__ignoreMap":447},[451,452,456,470],"callout",{"className":453},[454,455],"[&_figure]:w-full","[&_figure]:m-0",[432,457,458,459,462,463],{},"If you encounter the error ",[436,460,461],{},"ERROR: Cannot read properties of undefined (reading 'sys') (x4)",", please proceed to install TypeScript as a dependency, as advised in this ",[464,465,469],"a",{"href":466,"rel":467},"https://github.com/nuxt/nuxt/issues/20936",[468],"nofollow","issue",[441,471,474],{"className":472,"code":473,"language":446,"meta":447},[444],"npm install -D typescript\n",[436,475,473],{"__ignoreMap":447},[427,477,479],{"id":478},"add-tailwind-css","Add Tailwind CSS",[432,481,482],{},"How to setup tailwindcss",[484,485,491,506,545],"tabs",{"className":486,"default-value":490},[487,488,489],"relative","mt-6","w-full","vite",[492,493,494,500],"tabs-list",{},[495,496,497],"tabs-trigger",{"value":490},[432,498,499],{},"@tailwindcss/vite",[495,501,503],{"value":502},"nuxt-module",[432,504,505],{},"@nuxtjs/tailwindcss",[507,508,509,515,522,531,537],"tabs-content",{"value":490},[441,510,513],{"className":511,"code":512,"language":446,"meta":447},[444],"npm install tailwindcss @tailwindcss/vite -D\n",[436,514,512],{"__ignoreMap":447},[432,516,517,518,521],{},"Replace everything in ",[436,519,520],{},"app/assets/css/tailwind.css"," with the following:",[441,523,529],{"className":524,"code":526,"language":527,"meta":528},[525],"language-css","@import \"tailwindcss\";\n","css","title=\"app/assets/css/tailwind.css\"",[436,530,526],{"__ignoreMap":447},[432,532,533,534,521],{},"Update ",[436,535,536],{},"nuxt.config.ts",[441,538,543],{"className":539,"code":541,"language":542,"meta":447},[540],"language-ts","import tailwindcss from '@tailwindcss/vite'\n\nexport default defineNuxtConfig({\n  // ...\n  css: ['~/assets/css/tailwind.css'],\n  vite: {\n    plugins: [\n      tailwindcss(),\n    ],\n  },\n})\n","ts",[436,544,541],{"__ignoreMap":447},[507,546,547,553,557,562],{"value":502},[441,548,551],{"className":549,"code":550,"language":446,"meta":447},[444],"npm install tailwindcss @nuxtjs/tailwindcss@7.0.0-beta.1 -D\n",[436,552,550],{"__ignoreMap":447},[432,554,517,555,521],{},[436,556,520],{},[441,558,560],{"className":559,"code":526,"language":527,"meta":528},[525],[436,561,526],{"__ignoreMap":447},[441,563,566],{"className":564,"code":565,"language":542,"meta":447},[540],"export default defineNuxtConfig({\n  // ...\n  modules: ['@nuxtjs/tailwindcss'],\n})\n",[436,567,565],{"__ignoreMap":447},[427,569,571,572,574],{"id":570},"add-nuxt-module","Add ",[436,573,29],{}," module",[432,576,577],{},"Skipping this step triggers numerous console warnings due to Nuxt's auto-import feature.",[484,579,582,595,606],{"className":580,"default-value":581},[487,488,489],"module",[492,583,584,589],{},[495,585,586],{"value":581},[432,587,588],{},"Module",[495,590,592],{"value":591},"manual",[432,593,594],{},"Manual",[507,596,597,600],{"value":581},[432,598,599],{},"Install the package below.",[441,601,604],{"className":602,"code":603,"language":446,"meta":447},[444],"npx nuxi@latest module add shadcn-nuxt\n",[436,605,603],{"__ignoreMap":447},[507,607,608,614,620,627],{"value":591},[432,609,610,611],{},"Install the ",[436,612,613],{},"@types/node",[441,615,618],{"className":616,"code":617,"language":446,"meta":447},[444],"npm install -D @types/node\n",[436,619,617],{"__ignoreMap":447},[432,621,622,623,626],{},"Add the following code to ",[436,624,625],{},"modules/shadcn.ts",".",[441,628,631],{"className":629,"code":630,"language":542,"meta":447},[540],"import { readdirSync } from 'node:fs'\nimport { join } from 'node:path'\nimport {\n  addComponentExports,\n  addComponentsDir,\n  createResolver,\n  defineNuxtModule,\n} from 'nuxt/kit'\n\nexport interface ShadcnVueOptions {\n  /**\n   * Prefix for all the imported component\n   * @default \"Ui\"\n   */\n  prefix: string\n\n  /**\n   * Directory that the component lives in.\n   * @default \"@/components/ui\"\n   */\n  componentDir: string\n}\n\nexport default defineNuxtModule\u003CShadcnVueOptions>({\n  defaults: {\n    prefix: 'Ui',\n    componentDir: '@/components/ui',\n  },\n  meta: {\n    name: 'ShadcnVue',\n    configKey: 'shadcn',\n    version: '0.0.1',\n    compatibility: {\n      nuxt: '>=3.17.0',\n    },\n  },\n  async setup({ componentDir, prefix }, nuxt) {\n    const COMPONENT_DIR_PATH = componentDir!\n    const ROOT_DIR_PATH = nuxt.options.rootDir\n    const { resolve, resolvePath } = createResolver(ROOT_DIR_PATH)\n\n    const componentsPath = await resolvePath(COMPONENT_DIR_PATH)\n\n    addComponentsDir({\n      path: componentsPath,\n      extensions: [],\n      ignore: ['**/*'],\n    }, {\n      prepend: true,\n    })\n\n    try {\n      await Promise.all(readdirSync(componentsPath).map(async (dir) => {\n        try {\n          const filePath = await resolvePath(join(COMPONENT_DIR_PATH, dir, 'index'), { extensions: ['.ts', '.js'] })\n\n          addComponentExports({\n            prefix,\n            filePath: resolve(filePath),\n            priority: 1,\n          })\n        }\n        catch (err) {\n          if (err instanceof Error)\n            console.warn('Module error: ', err.message)\n        }\n      }))\n    }\n    catch (err) {\n      if (err instanceof Error)\n        console.warn(err.message)\n    }\n  },\n})\n",[436,632,630],{"__ignoreMap":447},[427,634,636,637],{"id":635},"configure-nuxtconfigts","Configure ",[436,638,536],{},[441,640,643],{"className":641,"code":642,"language":542,"meta":447},[540],"export default defineNuxtConfig({\n  // ...\n  modules: ['shadcn-nuxt'],\n  shadcn: {\n    /**\n     * Prefix for all the imported component.\n     * @default \"Ui\"\n     */\n    prefix: '',\n    /**\n     * Directory that the component lives in.\n     * Will respect the Nuxt aliases.\n     * @link https://nuxt.com/docs/api/nuxt-config#alias\n     * @default \"@/components/ui\"\n     */\n    componentDir: '@/components/ui'\n  }\n})\n",[436,644,642],{"__ignoreMap":447},[427,646,648],{"id":647},"add-a-nuxt-plugin-for-providing-ssrwidth-optional","Add a Nuxt Plugin for providing ssrWidth (optional)",[432,650,651],{},"Some components require a ssrWidth to be set through VueUse to avoid Hydration errors on mobile.",[432,653,654,655],{},"Add the following plugin to your Nuxt application: ",[436,656,657],{},"app/plugins/ssr-width.ts",[432,659,660,661],{},"Read more about ",[464,662,665],{"href":663,"rel":664},"https://vueuse.org/core/useSSRWidth/",[468],[436,666,667],{},"useSSRWidth",[441,669,672],{"className":670,"code":671,"language":542,"meta":447},[540],"import { provideSSRWidth } from '@vueuse/core'\n\nexport default defineNuxtPlugin((nuxtApp) => {\n  provideSSRWidth(1024, nuxtApp.vueApp)\n})\n",[436,673,671],{"__ignoreMap":447},[427,675,677],{"id":676},"run-nuxt-prepare","Run Nuxt Prepare",[432,679,680,681,684],{},"If you are initiating a new project, you need to run the command so that Nuxt generates the necessary ",[436,682,683],{},".nuxt"," folder:",[441,686,689],{"className":687,"code":688,"language":446,"meta":447},[444],"npx nuxi prepare\n",[436,690,688],{"__ignoreMap":447},[427,692,694],{"id":693},"run-the-cli","Run the CLI",[432,696,697,698,700],{},"Run the ",[436,699,408],{}," init command to setup your project:",[441,702,705],{"className":703,"code":704,"language":446,"meta":447},[444],"npx shadcn-vue@latest init\n",[436,706,704],{"__ignoreMap":447},[432,708,709,710,626],{},"You will be asked a few questions to configure ",[436,711,45],{},[441,713,718],{"className":714,"code":716,"language":717,"meta":447},[715],"language-txt","Which color would you like to use as base color? › Neutral\n","txt",[436,719,716],{"__ignoreMap":447},[427,721,723],{"id":722},"add-components","Add Components",[432,725,726],{},"You can now start adding components to your project.",[441,728,731],{"className":729,"code":730,"language":446,"meta":447},[444],"npx shadcn-vue@latest add button\n",[436,732,730],{"__ignoreMap":447},[432,734,735,736,738],{},"The command above will add the ",[436,737,125],{}," component to your project. Nuxt autoImport will handle importing the components, you can just use it as such:",[441,740,748],{"className":741,"code":743,"highlights":744,"language":746,"meta":747},[742],"language-vue","\u003Ctemplate>\n  \u003Cdiv>\n    \u003CButton>Click me\u003C/Button>\n  \u003C/div>\n\u003C/template>\n",[745],3,"vue","showLineNumbers title=\"pages/index.vue\"",[436,749,743],{"__ignoreMap":447},{"title":447,"searchDepth":751,"depth":751,"links":752},2,[753,754,755,757,759,760,761,762],{"id":429,"depth":745,"text":430},{"id":478,"depth":745,"text":479},{"id":570,"depth":745,"text":756},"Add Nuxt module",{"id":635,"depth":745,"text":758},"Configure nuxt.config.ts",{"id":647,"depth":745,"text":648},{"id":676,"depth":745,"text":677},{"id":693,"depth":745,"text":694},{"id":722,"depth":745,"text":723},"Install and configure Nuxt.","md",null,{},"---\ntitle: Nuxt\ndescription: Install and configure Nuxt.\n---\n\n\u003CSteps>\n\n### Create project\n\nStart by creating a new Nuxt project using `create-nuxt-app`:\n\n```bash\nnpm create nuxt@latest\n```\n\n\u003CCallout class=\"[&_figure]:w-full [&_figure]:m-0\">\n\nIf you encounter the error `ERROR: Cannot read properties of undefined (reading 'sys') (x4)`, please proceed to install TypeScript as a dependency, as advised in this [issue](https://github.com/nuxt/nuxt/issues/20936)\n\n```bash\nnpm install -D typescript\n```\n\n\u003C/Callout>\n\n### Add Tailwind CSS\n\nHow to setup tailwindcss\n\n::tabs{default-value=\"vite\" class=\"relative mt-6 w-full\"}\n  ::tabs-list\n    ::tabs-trigger{value=\"vite\"}\n      @tailwindcss/vite\n    ::\n\n    ::tabs-trigger{value=\"nuxt-module\"}\n      @nuxtjs/tailwindcss\n    ::\n  ::\n\n  ::tabs-content{value=\"vite\"}\n\n    ```bash\n    npm install tailwindcss @tailwindcss/vite -D\n    ```\n\n    Replace everything in `app/assets/css/tailwind.css` with the following:\n\n    ```css title=\"app/assets/css/tailwind.css\"\n    @import \"tailwindcss\";\n    ```\n\n    Update `nuxt.config.ts` with the following:\n\n    ```ts\n    import tailwindcss from '@tailwindcss/vite'\n\n    export default defineNuxtConfig({\n      // ...\n      css: ['~/assets/css/tailwind.css'],\n      vite: {\n        plugins: [\n          tailwindcss(),\n        ],\n      },\n    })\n    ```\n\n  ::\n\n  ::tabs-content{value=\"nuxt-module\"}\n\n     ```bash\n    npm install tailwindcss @nuxtjs/tailwindcss@7.0.0-beta.1 -D\n    ```\n\n    Replace everything in `app/assets/css/tailwind.css` with the following:\n\n    ```css title=\"app/assets/css/tailwind.css\"\n    @import \"tailwindcss\";\n    ```\n\n    ```ts\n    export default defineNuxtConfig({\n      // ...\n      modules: ['@nuxtjs/tailwindcss'],\n    })\n    ```\n\n  ::\n::\n\n### Add `Nuxt` module\n\nSkipping this step triggers numerous console warnings due to Nuxt's auto-import feature.\n\n::tabs{default-value=\"module\" class=\"relative mt-6 w-full\"}\n  ::tabs-list\n    ::tabs-trigger{value=\"module\"}\n      Module\n    ::\n\n    ::tabs-trigger{value=\"manual\"}\n      Manual\n    ::\n  ::\n\n  ::tabs-content{value=\"module\"}\n\n    Install the package below.\n\n    ```bash\n  npx nuxi@latest module add shadcn-nuxt\n    ```\n  ::\n\n  ::tabs-content{value=\"manual\"}\n\n  Install the `@types/node`\n\n  ```bash\n  npm install -D @types/node\n  ```\n\n  Add the following code to `modules/shadcn.ts`.\n\n  ```ts\n  import { readdirSync } from 'node:fs'\n  import { join } from 'node:path'\n  import {\n    addComponentExports,\n    addComponentsDir,\n    createResolver,\n    defineNuxtModule,\n  } from 'nuxt/kit'\n\n  export interface ShadcnVueOptions {\n    /**\n     * Prefix for all the imported component\n     * @default \"Ui\"\n     */\n    prefix: string\n\n    /**\n     * Directory that the component lives in.\n     * @default \"@/components/ui\"\n     */\n    componentDir: string\n  }\n\n  export default defineNuxtModule\u003CShadcnVueOptions>({\n    defaults: {\n      prefix: 'Ui',\n      componentDir: '@/components/ui',\n    },\n    meta: {\n      name: 'ShadcnVue',\n      configKey: 'shadcn',\n      version: '0.0.1',\n      compatibility: {\n        nuxt: '>=3.17.0',\n      },\n    },\n    async setup({ componentDir, prefix }, nuxt) {\n      const COMPONENT_DIR_PATH = componentDir!\n      const ROOT_DIR_PATH = nuxt.options.rootDir\n      const { resolve, resolvePath } = createResolver(ROOT_DIR_PATH)\n\n      const componentsPath = await resolvePath(COMPONENT_DIR_PATH)\n\n      addComponentsDir({\n        path: componentsPath,\n        extensions: [],\n        ignore: ['**/*'],\n      }, {\n        prepend: true,\n      })\n\n      try {\n        await Promise.all(readdirSync(componentsPath).map(async (dir) => {\n          try {\n            const filePath = await resolvePath(join(COMPONENT_DIR_PATH, dir, 'index'), { extensions: ['.ts', '.js'] })\n\n            addComponentExports({\n              prefix,\n              filePath: resolve(filePath),\n              priority: 1,\n            })\n          }\n          catch (err) {\n            if (err instanceof Error)\n              console.warn('Module error: ', err.message)\n          }\n        }))\n      }\n      catch (err) {\n        if (err instanceof Error)\n          console.warn(err.message)\n      }\n    },\n  })\n  ```\n\n  ::\n::\n\n### Configure `nuxt.config.ts`\n\n```ts\nexport default defineNuxtConfig({\n  // ...\n  modules: ['shadcn-nuxt'],\n  shadcn: {\n    /**\n     * Prefix for all the imported component.\n     * @default \"Ui\"\n     */\n    prefix: '',\n    /**\n     * Directory that the component lives in.\n     * Will respect the Nuxt aliases.\n     * @link https://nuxt.com/docs/api/nuxt-config#alias\n     * @default \"@/components/ui\"\n     */\n    componentDir: '@/components/ui'\n  }\n})\n```\n\n### Add a Nuxt Plugin for providing ssrWidth (optional)\n\nSome components require a ssrWidth to be set through VueUse to avoid Hydration errors on mobile.\n\nAdd the following plugin to your Nuxt application: `app/plugins/ssr-width.ts`\n\nRead more about [`useSSRWidth`](https://vueuse.org/core/useSSRWidth/)\n\n```ts\nimport { provideSSRWidth } from '@vueuse/core'\n\nexport default defineNuxtPlugin((nuxtApp) => {\n  provideSSRWidth(1024, nuxtApp.vueApp)\n})\n```\n\n### Run Nuxt Prepare\n\nIf you are initiating a new project, you need to run the command so that Nuxt generates the necessary `.nuxt` folder:\n\n```bash\nnpx nuxi prepare\n```\n\n### Run the CLI\n\nRun the `shadcn-vue` init command to setup your project:\n\n```bash\nnpx shadcn-vue@latest init\n```\n\nYou will be asked a few questions to configure `components.json`.\n\n```txt\nWhich color would you like to use as base color? › Neutral\n```\n\n### Add Components\n\nYou can now start adding components to your project.\n\n```bash\nnpx shadcn-vue@latest add button\n```\n\nThe command above will add the `Button` component to your project. Nuxt autoImport will handle importing the components, you can just use it as such:\n\n```vue {3} showLineNumbers title=\"pages/index.vue\"\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003CButton>Click me\u003C/Button>\n  \u003C/div>\n\u003C/template>\n```\n\n\u003C/Steps>\n",{"title":29,"description":763},"G-2rNPtGLinCFpY_mK67L3sWQYPYAL2WUbL0Tp6-v0k",[771,772],{"title":25,"path":26,"stem":27,"children":-1},{"title":33,"path":34,"stem":35,"children":-1},1775650005202]