[{"data":1,"prerenderedAt":947},["ShallowReactive",2],{"navigation":3,"$fMW9jOOkNpZriWVK3P_bZYNOyYR2IEPvrHsC7cDBlJJc":405,"/docs/registry/getting-started":418,"surround-/docs/registry/getting-started":944},[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":394,"body":420,"description":937,"extension":938,"links":939,"meta":940,"navigation":132,"new":17,"path":395,"rawbody":941,"seo":942,"stem":396,"__hash__":943},"content/docs/registry/getting-started.md",{"type":421,"value":422,"toc":916},"minimark",[423,427,430,434,444,452,486,490,635,639,725,729,736,742,752,756,759,763,768,778,789,793,797,800,896,900,910],[424,425,426],"p",{},"This guide will walk you through the process of setting up your own component registry.",[424,428,429],{},"It assumes you already have a project with components and would like to turn it into a registry.",[431,432,402],"h2",{"id":433},"registryjson",[424,435,436,437,440,441,443],{},"The ",[438,439,402],"code",{}," file is only required if you're using the ",[438,442,408],{}," CLI to build your registry.",[424,445,446,447,451],{},"If you're using a different build system, you can skip this step as long as your build system produces valid JSON files that conform to the ",[448,449,450],"a",{"href":399},"registry-item schema specification",".",[453,454,455,460,466,477],"steps",{},[456,457,459],"h3",{"id":458},"add-a-registryjson-file","Add a registry.json file",[424,461,462,463,465],{},"Create a ",[438,464,402],{}," file in the root of your project. Your project can be a Nuxt, Vite, or any other project that supports Vue.",[467,468,474],"pre",{"className":469,"code":471,"language":472,"meta":473},[470],"language-json","{\n  \"$schema\": \"https://shadcn-vue.com/schema/registry.json\",\n  \"name\": \"acme\",\n  \"homepage\": \"https://acme.com\",\n  \"items\": [\n    // ...\n  ]\n}\n","json","showLineNumbers title=\"registry.json\"",[438,475,471],{"__ignoreMap":476},"",[424,478,479,480,482,483,451],{},"This ",[438,481,402],{}," file must conform to the ",[448,484,485],{"href":403},"registry schema specification",[431,487,489],{"id":488},"add-a-registry-item","Add a registry item",[453,491,492,496,503,512,535,543,566,570,575,594,614,629],{},[456,493,495],{"id":494},"create-your-component","Create your component",[424,497,498,499,502],{},"Add your first component. Here's an example of a simple ",[438,500,501],{},"\u003CHelloWorld />"," component:",[467,504,510],{"className":505,"code":507,"language":508,"meta":509},[506],"language-vue","\u003Cscript setup lang=\"ts\">\nimport { Button } from \"@/components/ui/button\"\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CButton>Hello World\u003C/Button>\n\u003C/template>\n","vue","showLineNumbers title=\"registry/new-york/HelloWorld/HelloWorld.vue\"",[438,511,507],{"__ignoreMap":476},[513,514,517],"callout",{"className":515},[516],"mt-6",[424,518,519,523,524,527,528,530,531,534],{},[520,521,522],"strong",{},"Note:"," This example places the component in the ",[438,525,526],{},"registry/new-york","\ndirectory. You can place it anywhere in your project as long as you set the\ncorrect path in the ",[438,529,402],{}," file and you follow the ",[438,532,533],{},"registry/[NAME]","\ndirectory structure.",[467,536,541],{"className":537,"code":539,"language":540,"meta":476},[538],"language-txt","registry\n└── new-york\n    └── HelloWorld\n        └── HelloWorld.vue\n","txt",[438,542,539],{"__ignoreMap":476},[513,544,547,557],{"className":545},[516,546],"[&_pre]:mb-0",[424,548,549,552,553,556],{},[520,550,551],{},"Important:"," If you're placing your component in a custom directory, make\nsure it is configured in your ",[438,554,555],{},"tailwind.config.ts"," file.",[467,558,564],{"className":559,"code":561,"language":562,"meta":563},[560],"language-ts","// tailwind.config.ts\nexport default {\n  content: [\"./registry/**/*.{js,ts,jsx,tsx,vue}\"],\n}\n","ts","showLineNumbers",[438,565,561],{"__ignoreMap":476},[456,567,569],{"id":568},"add-your-component-to-the-registry","Add your component to the registry",[424,571,572,573,451],{},"To add your component to the registry, you need to add your component definition to ",[438,574,402],{},[467,576,592],{"className":577,"code":578,"highlights":579,"language":472,"meta":473},[470],"{\n  \"$schema\": \"https://shadcn-vue.com/schema/registry.json\",\n  \"name\": \"acme\",\n  \"homepage\": \"https://acme.com\",\n  \"items\": [\n    {\n      \"name\": \"hello-world\",\n      \"type\": \"registry:block\",\n      \"title\": \"Hello World\",\n      \"description\": \"A simple hello world component.\",\n      \"files\": [\n        {\n          \"path\": \"registry/new-york/HelloWorld/HelloWorld.vue\",\n          \"type\": \"registry:component\"\n        }\n      ]\n    }\n  ]\n}\n",[580,581,582,583,584,585,586,587,588,589,590,591],6,7,8,9,10,11,12,13,14,15,16,17,[438,593,578],{"__ignoreMap":476},[424,595,596,597,600,601,600,604,600,607,610,611,451],{},"You define your registry item by adding a ",[438,598,599],{},"name",", ",[438,602,603],{},"type",[438,605,606],{},"title",[438,608,609],{},"description"," and ",[438,612,613],{},"files",[424,615,616,617,610,620,622,623,625,626,628],{},"For every file you add, you must specify the ",[438,618,619],{},"path",[438,621,603],{}," of the file. The ",[438,624,619],{}," is the relative path to the file from the root of your project. The ",[438,627,603],{}," is the type of the file.",[424,630,631,632,451],{},"You can read more about the registry item schema and file types in the ",[448,633,634],{"href":399},"registry item schema docs",[431,636,638],{"id":637},"build-your-registry","Build your registry",[453,640,641,645,656,664,668,678,685,689,692,698],{},[456,642,644],{"id":643},"install-the-shadcn-vue-cli","Install the shadcn-vue CLI",[424,646,647,648,651,652,655],{},"Note: the ",[438,649,650],{},"build"," command is currently only available in the ",[438,653,654],{},"shadcn-vue@canary"," version of the CLI.",[467,657,662],{"className":658,"code":660,"language":661,"meta":476},[659],"language-bash","npm install shadcn-vue@latest\n","bash",[438,663,660],{"__ignoreMap":476},[456,665,667],{"id":666},"add-a-build-script","Add a build script",[424,669,670,671,674,675,556],{},"Add a ",[438,672,673],{},"registry:build"," script to your ",[438,676,677],{},"package.json",[467,679,683],{"className":680,"code":681,"language":472,"meta":682},[470],"{\n  \"scripts\": {\n    \"registry:build\": \"shadcn-vue build\"\n  }\n}\n","showLineNumbers title=\"package.json\"",[438,684,681],{"__ignoreMap":476},[456,686,688],{"id":687},"run-the-build-script","Run the build script",[424,690,691],{},"Run the build script to generate the registry JSON files.",[467,693,696],{"className":694,"code":695,"language":661,"meta":476},[659],"npm run registry:build\n",[438,697,695],{"__ignoreMap":476},[513,699,701,713],{"className":700},[516],[424,702,703,705,706,709,710,451],{},[520,704,522],{}," By default, the build script will generate the registry JSON files in ",[438,707,708],{},"public/r"," e.g ",[438,711,712],{},"public/r/hello-world.json",[424,714,715,716,719,720,724],{},"You can change the output directory by passing the ",[438,717,718],{},"--output"," option. See the ",[448,721,723],{"href":722},"/docs/cli#build","shadcn-vue build command"," for more information.",[431,726,728],{"id":727},"serve-your-registry","Serve your registry",[424,730,731,732,735],{},"If you're running your registry on Nuxt, you can now serve your registry by running the ",[438,733,734],{},"nuxt"," server. The command might differ for other frameworks.",[467,737,740],{"className":738,"code":739,"language":661,"meta":476},[659],"npm run dev\n",[438,741,739],{"__ignoreMap":476},[424,743,744,745,748,749,451],{},"Your files will now be served at ",[438,746,747],{},"http://localhost:3000/r/[NAME].json"," eg. ",[438,750,751],{},"http://localhost:3000/r/hello-world.json",[431,753,755],{"id":754},"publish-your-registry","Publish your registry",[424,757,758],{},"To make your registry available to other developers, you can publish it by deploying your project to a public URL.",[431,760,762],{"id":761},"adding-auth","Adding Auth",[424,764,436,765,767],{},[438,766,408],{}," CLI does not offer a built-in way to add auth to your registry. We recommend handling authorization on your registry server.",[424,769,770,771,774,775,451],{},"A common simple approach is to use a ",[438,772,773],{},"token"," query parameter to authenticate requests to your registry. e.g. ",[438,776,777],{},"http://localhost:3000/r/hello-world.json?token=[SECURE_TOKEN_HERE]",[424,779,780,781,784,785,788],{},"Use the secure token to authenticate requests and return a 401 Unauthorized response if the token is invalid. Both the ",[438,782,783],{},"shadcn"," CLI and ",[438,786,787],{},"Open in v0"," will handle the 401 response and display a message to the user.",[513,790,792],{"className":791},[516],"\n  **Note:** Make sure to encrypt and expire tokens.\n",[431,794,796],{"id":795},"guidelines","Guidelines",[424,798,799],{},"Here are some guidelines to follow when building components for a registry.",[801,802,803,819,830,850,871,883],"ul",{},[804,805,806,807,810,811,814,815,818],"li",{},"Place your registry item in the ",[438,808,809],{},"registry/[STYLE]/[NAME]"," directory. I'm using ",[438,812,813],{},"new-york"," as an example. It can be anything you want as long as it's nested under the ",[438,816,817],{},"registry"," directory.",[804,820,821,822,600,824,600,826,610,828,451],{},"The following properties are required for the block definition: ",[438,823,599],{},[438,825,609],{},[438,827,603],{},[438,829,613],{},[804,831,832,833,836,837,600,840,600,843,846,847,451],{},"Make sure to list all registry dependencies in ",[438,834,835],{},"registryDependencies",". A registry dependency is the name of the component in the registry eg. ",[438,838,839],{},"input",[438,841,842],{},"button",[438,844,845],{},"card",", etc or a URL to a registry item eg. ",[438,848,849],{},"http://localhost:3000/r/editor.json",[804,851,852,853,856,857,600,860,863,864,867,868,451],{},"Make sure to list all dependencies in ",[438,854,855],{},"dependencies",". A dependency is the name of the package in the registry eg. ",[438,858,859],{},"zod",[438,861,862],{},"sonner",", etc. To set a version, you can use the ",[438,865,866],{},"name@version"," format eg. ",[438,869,870],{},"zod@^3.20.0",[804,872,873,748,880],{},[520,874,875,876,879],{},"Imports should always use the ",[438,877,878],{},"@/registry"," path.",[438,881,882],{},"import { HelloWorld } from \"@/registry/new-york/hello-world/hello-world\"",[804,884,885,886,600,889,600,892,895],{},"Ideally, place your files within a registry item in ",[438,887,888],{},"components",[438,890,891],{},"hooks",[438,893,894],{},"lib"," directories.",[431,897,899],{"id":898},"install-using-the-cli","Install using the CLI",[424,901,902,903,905,906,909],{},"To install a registry item using the ",[438,904,408],{}," CLI, use the ",[438,907,908],{},"add"," command followed by the URL of the registry item.",[467,911,914],{"className":912,"code":913,"language":661,"meta":476},[659],"npx shadcn-vue@latest add http://localhost:3000/r/hello-world.json\n",[438,915,913],{"__ignoreMap":476},{"title":476,"searchDepth":917,"depth":917,"links":918},2,[919,923,927,932,933,934,935,936],{"id":433,"depth":917,"text":402,"children":920},[921],{"id":458,"depth":922,"text":459},3,{"id":488,"depth":917,"text":489,"children":924},[925,926],{"id":494,"depth":922,"text":495},{"id":568,"depth":922,"text":569},{"id":637,"depth":917,"text":638,"children":928},[929,930,931],{"id":643,"depth":922,"text":644},{"id":666,"depth":922,"text":667},{"id":687,"depth":922,"text":688},{"id":727,"depth":917,"text":728},{"id":754,"depth":917,"text":755},{"id":761,"depth":917,"text":762},{"id":795,"depth":917,"text":796},{"id":898,"depth":917,"text":899},"Learn how to get setup and run your own component registry.","md",null,{},"---\ntitle: Getting Started\ndescription: Learn how to get setup and run your own component registry.\n---\n\nThis guide will walk you through the process of setting up your own component registry.\n\nIt assumes you already have a project with components and would like to turn it into a registry.\n\n\u003C!-- If you're starting a new registry project, you can use the [registry template](https://github.com/shadcn-ui/registry-template) as a starting point. We have already configured it for you. -->\n\n## registry.json\n\nThe `registry.json` file is only required if you're using the `shadcn-vue` CLI to build your registry.\n\nIf you're using a different build system, you can skip this step as long as your build system produces valid JSON files that conform to the [registry-item schema specification](/docs/registry/registry-item-json).\n\n\u003CSteps>\n\n### Add a registry.json file\n\nCreate a `registry.json` file in the root of your project. Your project can be a Nuxt, Vite, or any other project that supports Vue.\n\n```json showLineNumbers title=\"registry.json\"\n{\n  \"$schema\": \"https://shadcn-vue.com/schema/registry.json\",\n  \"name\": \"acme\",\n  \"homepage\": \"https://acme.com\",\n  \"items\": [\n    // ...\n  ]\n}\n```\n\nThis `registry.json` file must conform to the [registry schema specification](/docs/registry/registry-json).\n\n\u003C/Steps>\n\n## Add a registry item\n\n\u003CSteps>\n\n### Create your component\n\nAdd your first component. Here's an example of a simple `\u003CHelloWorld />` component:\n\n```vue showLineNumbers title=\"registry/new-york/HelloWorld/HelloWorld.vue\"\n\u003Cscript setup lang=\"ts\">\nimport { Button } from \"@/components/ui/button\"\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CButton>Hello World\u003C/Button>\n\u003C/template>\n```\n\n\u003CCallout class=\"mt-6\">\n\n  **Note:** This example places the component in the `registry/new-york`\n  directory. You can place it anywhere in your project as long as you set the\n  correct path in the `registry.json` file and you follow the `registry/[NAME]`\n  directory structure.\n\n\u003C/Callout>\n\n```txt\nregistry\n└── new-york\n    └── HelloWorld\n        └── HelloWorld.vue\n```\n\n\u003CCallout class=\"mt-6 [&_pre]:mb-0\">\n\n  **Important:** If you're placing your component in a custom directory, make\n  sure it is configured in your `tailwind.config.ts` file.\n\n```ts showLineNumbers\n// tailwind.config.ts\nexport default {\n  content: [\"./registry/**/*.{js,ts,jsx,tsx,vue}\"],\n}\n```\n\n\u003C/Callout>\n\n### Add your component to the registry\n\nTo add your component to the registry, you need to add your component definition to `registry.json`.\n\n```json showLineNumbers title=\"registry.json\"  {6-17}\n{\n  \"$schema\": \"https://shadcn-vue.com/schema/registry.json\",\n  \"name\": \"acme\",\n  \"homepage\": \"https://acme.com\",\n  \"items\": [\n    {\n      \"name\": \"hello-world\",\n      \"type\": \"registry:block\",\n      \"title\": \"Hello World\",\n      \"description\": \"A simple hello world component.\",\n      \"files\": [\n        {\n          \"path\": \"registry/new-york/HelloWorld/HelloWorld.vue\",\n          \"type\": \"registry:component\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nYou define your registry item by adding a `name`, `type`, `title`, `description` and `files`.\n\nFor every file you add, you must specify the `path` and `type` of the file. The `path` is the relative path to the file from the root of your project. The `type` is the type of the file.\n\nYou can read more about the registry item schema and file types in the [registry item schema docs](/docs/registry/registry-item-json).\n\n\u003C/Steps>\n\n## Build your registry\n\n\u003CSteps>\n\n### Install the shadcn-vue CLI\n\nNote: the `build` command is currently only available in the `shadcn-vue@canary` version of the CLI.\n\n```bash\nnpm install shadcn-vue@latest\n```\n\n### Add a build script\n\nAdd a `registry:build` script to your `package.json` file.\n\n```json showLineNumbers title=\"package.json\"\n{\n  \"scripts\": {\n    \"registry:build\": \"shadcn-vue build\"\n  }\n}\n```\n\n### Run the build script\n\nRun the build script to generate the registry JSON files.\n\n```bash\nnpm run registry:build\n```\n\n\u003CCallout class=\"mt-6\">\n\n**Note:** By default, the build script will generate the registry JSON files in `public/r` e.g `public/r/hello-world.json`.\n\nYou can change the output directory by passing the `--output` option. See the [shadcn-vue build command](/docs/cli#build) for more information.\n\n\u003C/Callout>\n\n\u003C/Steps>\n\n## Serve your registry\n\nIf you're running your registry on Nuxt, you can now serve your registry by running the `nuxt` server. The command might differ for other frameworks.\n\n```bash\nnpm run dev\n```\n\nYour files will now be served at `http://localhost:3000/r/[NAME].json` eg. `http://localhost:3000/r/hello-world.json`.\n\n## Publish your registry\n\nTo make your registry available to other developers, you can publish it by deploying your project to a public URL.\n\n## Adding Auth\n\nThe `shadcn-vue` CLI does not offer a built-in way to add auth to your registry. We recommend handling authorization on your registry server.\n\nA common simple approach is to use a `token` query parameter to authenticate requests to your registry. e.g. `http://localhost:3000/r/hello-world.json?token=[SECURE_TOKEN_HERE]`.\n\nUse the secure token to authenticate requests and return a 401 Unauthorized response if the token is invalid. Both the `shadcn` CLI and `Open in v0` will handle the 401 response and display a message to the user.\n\n\u003CCallout class=\"mt-6\">\n  **Note:** Make sure to encrypt and expire tokens.\n\u003C/Callout>\n\n## Guidelines\n\nHere are some guidelines to follow when building components for a registry.\n\n- Place your registry item in the `registry/[STYLE]/[NAME]` directory. I'm using `new-york` as an example. It can be anything you want as long as it's nested under the `registry` directory.\n- The following properties are required for the block definition: `name`, `description`, `type` and `files`.\n- Make sure to list all registry dependencies in `registryDependencies`. A registry dependency is the name of the component in the registry eg. `input`, `button`, `card`, etc or a URL to a registry item eg. `http://localhost:3000/r/editor.json`.\n- Make sure to list all dependencies in `dependencies`. A dependency is the name of the package in the registry eg. `zod`, `sonner`, etc. To set a version, you can use the `name@version` format eg. `zod@^3.20.0`.\n- **Imports should always use the `@/registry` path.** eg. `import { HelloWorld } from \"@/registry/new-york/hello-world/hello-world\"`\n- Ideally, place your files within a registry item in `components`, `hooks`, `lib` directories.\n\n## Install using the CLI\n\nTo install a registry item using the `shadcn-vue` CLI, use the `add` command followed by the URL of the registry item.\n\n```bash\nnpx shadcn-vue@latest add http://localhost:3000/r/hello-world.json\n```\n",{"title":394,"description":937},"kVXFewyrz4_Gd59HD7pa2YC_f2kJzXF4beMjxOX8MYI",[945,946],{"title":390,"path":391,"stem":392,"children":-1},{"title":398,"path":399,"stem":400,"children":-1},1775650003815]