[{"data":1,"prerenderedAt":947},["ShallowReactive",2],{"navigation":3,"$fMW9jOOkNpZriWVK3P_bZYNOyYR2IEPvrHsC7cDBlJJc":404,"/docs/registry/getting-started":417,"surround-/docs/registry/getting-started":944},[4],{"title":5,"path":6,"stem":7,"children":8,"page":18},"Docs","/docs","docs",[9,273,299,317,330,356],{"title":10,"path":11,"stem":12,"children":13,"new":18,"type":272},"Components","/docs/components","docs/02.components",[14,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268],{"title":15,"path":16,"stem":17,"new":18,"type":19,"children":-1},"Accordion","/docs/components/accordion","docs/components/accordion",false,"component",{"title":21,"path":22,"stem":23,"new":18,"type":19,"children":-1},"Alert","/docs/components/alert","docs/components/alert",{"title":25,"path":26,"stem":27,"new":18,"type":19,"children":-1},"Alert Dialog","/docs/components/alert-dialog","docs/components/alert-dialog",{"title":29,"path":30,"stem":31,"new":18,"type":19,"children":-1},"Aspect Ratio","/docs/components/aspect-ratio","docs/components/aspect-ratio",{"title":33,"path":34,"stem":35,"new":18,"type":19,"children":-1},"Avatar","/docs/components/avatar","docs/components/avatar",{"title":37,"path":38,"stem":39,"new":18,"type":19,"children":-1},"Badge","/docs/components/badge","docs/components/badge",{"title":41,"path":42,"stem":43,"new":18,"type":19,"children":-1},"Breadcrumb","/docs/components/breadcrumb","docs/components/breadcrumb",{"title":45,"path":46,"stem":47,"new":18,"type":19,"children":-1},"Button","/docs/components/button","docs/components/button",{"title":49,"path":50,"stem":51,"new":18,"type":19,"children":-1},"Button Group","/docs/components/button-group","docs/components/button-group",{"title":53,"path":54,"stem":55,"new":18,"type":19,"children":-1},"Calendar","/docs/components/calendar","docs/components/calendar",{"title":57,"path":58,"stem":59,"new":18,"type":19,"children":-1},"Card","/docs/components/card","docs/components/card",{"title":61,"path":62,"stem":63,"new":18,"type":19,"children":-1},"Carousel","/docs/components/carousel","docs/components/carousel",{"title":65,"path":66,"stem":67,"new":18,"type":19,"children":-1},"Chart","/docs/components/chart","docs/components/chart",{"title":69,"path":70,"stem":71,"new":18,"type":19,"children":-1},"Checkbox","/docs/components/checkbox","docs/components/checkbox",{"title":73,"path":74,"stem":75,"new":18,"type":19,"children":-1},"Collapsible","/docs/components/collapsible","docs/components/collapsible",{"title":77,"path":78,"stem":79,"new":18,"type":19,"children":-1},"Combobox","/docs/components/combobox","docs/components/combobox",{"title":81,"path":82,"stem":83,"new":18,"type":19,"children":-1},"Command","/docs/components/command","docs/components/command",{"title":85,"path":86,"stem":87,"new":18,"type":19,"children":-1},"Context Menu","/docs/components/context-menu","docs/components/context-menu",{"title":89,"path":90,"stem":91,"new":18,"type":19,"children":-1},"Data Table","/docs/components/data-table","docs/components/data-table",{"title":93,"path":94,"stem":95,"new":18,"type":19,"children":-1},"Date Picker","/docs/components/date-picker","docs/components/date-picker",{"title":97,"path":98,"stem":99,"new":18,"type":19,"children":-1},"Dialog","/docs/components/dialog","docs/components/dialog",{"title":101,"path":102,"stem":103,"new":18,"type":19,"children":-1},"Drawer","/docs/components/drawer","docs/components/drawer",{"title":105,"path":106,"stem":107,"new":18,"type":19,"children":-1},"Dropdown Menu","/docs/components/dropdown-menu","docs/components/dropdown-menu",{"title":109,"path":110,"stem":111,"new":18,"type":19,"children":-1},"Empty","/docs/components/empty","docs/components/empty",{"title":113,"path":114,"stem":115,"new":18,"type":19,"children":-1},"Field","/docs/components/field","docs/components/field",{"title":117,"path":118,"stem":119,"new":18,"type":19,"children":-1},"Form","/docs/components/form","docs/components/form",{"title":121,"path":122,"stem":123,"new":18,"type":19,"children":-1},"Hover Card","/docs/components/hover-card","docs/components/hover-card",{"title":125,"path":126,"stem":127,"new":18,"type":19,"children":-1},"Input","/docs/components/input","docs/components/input",{"title":129,"path":130,"stem":131,"new":18,"type":19,"children":-1},"Input Group","/docs/components/input-group","docs/components/input-group",{"title":133,"path":134,"stem":135,"new":18,"type":19,"children":-1},"Input OTP","/docs/components/input-otp","docs/components/input-otp",{"title":137,"path":138,"stem":139,"new":18,"type":19,"children":-1},"Item","/docs/components/item","docs/components/item",{"title":141,"path":142,"stem":143,"new":18,"type":19,"children":-1},"Kbd","/docs/components/kbd","docs/components/kbd",{"title":145,"path":146,"stem":147,"new":18,"type":19,"children":-1},"Label","/docs/components/label","docs/components/label",{"title":149,"path":150,"stem":151,"new":18,"type":19,"children":-1},"Menubar","/docs/components/menubar","docs/components/menubar",{"title":153,"path":154,"stem":155,"new":18,"type":19,"children":-1},"Native Select","/docs/components/native-select","docs/components/native-select",{"title":157,"path":158,"stem":159,"new":18,"type":19,"children":-1},"Navigation Menu","/docs/components/navigation-menu","docs/components/navigation-menu",{"title":161,"path":162,"stem":163,"new":18,"type":19,"children":-1},"Number Field","/docs/components/number-field","docs/components/number-field",{"title":165,"path":166,"stem":167,"new":18,"type":19,"children":-1},"Pagination","/docs/components/pagination","docs/components/pagination",{"title":169,"path":170,"stem":171,"new":18,"type":19,"children":-1},"Pin Input","/docs/components/pin-input","docs/components/pin-input",{"title":173,"path":174,"stem":175,"new":18,"type":19,"children":-1},"Popover","/docs/components/popover","docs/components/popover",{"title":177,"path":178,"stem":179,"new":18,"type":19,"children":-1},"Progress","/docs/components/progress","docs/components/progress",{"title":181,"path":182,"stem":183,"new":18,"type":19,"children":-1},"Radio Group","/docs/components/radio-group","docs/components/radio-group",{"title":185,"path":186,"stem":187,"new":18,"type":19,"children":-1},"Range Calendar","/docs/components/range-calendar","docs/components/range-calendar",{"title":189,"path":190,"stem":191,"new":18,"type":19,"children":-1},"Resizable","/docs/components/resizable","docs/components/resizable",{"title":193,"path":194,"stem":195,"new":18,"type":19,"children":-1},"Scroll Area","/docs/components/scroll-area","docs/components/scroll-area",{"title":197,"path":198,"stem":199,"new":18,"type":19,"children":-1},"Select","/docs/components/select","docs/components/select",{"title":201,"path":202,"stem":203,"new":18,"type":19,"children":-1},"Separator","/docs/components/separator","docs/components/separator",{"title":205,"path":206,"stem":207,"new":18,"type":19,"children":-1},"Sheet","/docs/components/sheet","docs/components/sheet",{"title":209,"path":210,"stem":211,"new":18,"type":19,"children":-1},"Sidebar","/docs/components/sidebar","docs/components/sidebar",{"title":213,"path":214,"stem":215,"new":18,"type":19,"children":-1},"Skeleton","/docs/components/skeleton","docs/components/skeleton",{"title":217,"path":218,"stem":219,"new":18,"type":19,"children":-1},"Slider","/docs/components/slider","docs/components/slider",{"title":221,"path":222,"stem":223,"new":18,"type":19,"children":-1},"Sonner","/docs/components/sonner","docs/components/sonner",{"title":225,"path":226,"stem":227,"new":18,"type":19,"children":-1},"Spinner","/docs/components/spinner","docs/components/spinner",{"title":229,"path":230,"stem":231,"new":18,"type":19,"children":-1},"Stepper","/docs/components/stepper","docs/components/stepper",{"title":233,"path":234,"stem":235,"new":18,"type":19,"children":-1},"Switch","/docs/components/switch","docs/components/switch",{"title":237,"path":238,"stem":239,"new":18,"type":19,"children":-1},"Table","/docs/components/table","docs/components/table",{"title":241,"path":242,"stem":243,"new":18,"type":19,"children":-1},"Tabs","/docs/components/tabs","docs/components/tabs",{"title":245,"path":246,"stem":247,"new":18,"type":19,"children":-1},"Tags Input","/docs/components/tags-input","docs/components/tags-input",{"title":249,"path":250,"stem":251,"new":18,"type":19,"children":-1},"Textarea","/docs/components/textarea","docs/components/textarea",{"title":253,"path":254,"stem":255,"new":18,"type":19,"children":-1},"Toast","/docs/components/toast","docs/components/toast",{"title":257,"path":258,"stem":259,"new":18,"type":19,"children":-1},"Toggle","/docs/components/toggle","docs/components/toggle",{"title":261,"path":262,"stem":263,"new":18,"type":19,"children":-1},"Toggle Group","/docs/components/toggle-group","docs/components/toggle-group",{"title":265,"path":266,"stem":267,"new":18,"type":19,"children":-1},"Tooltip","/docs/components/tooltip","docs/components/tooltip",{"title":269,"path":270,"stem":271,"new":18,"type":19,"children":-1},"Typography","/docs/components/typography","docs/components/typography","group",{"title":274,"path":275,"stem":276,"children":277,"new":18,"type":272},"Installation","/docs/installation","docs/02.installation",[278,283,287,291,295],{"title":279,"path":280,"stem":281,"new":18,"type":282,"children":-1},"Vite","/docs/installation/vite","docs/installation/01.vite","page",{"title":284,"path":285,"stem":286,"new":18,"type":282,"children":-1},"Nuxt","/docs/installation/nuxt","docs/installation/02.nuxt",{"title":288,"path":289,"stem":290,"new":18,"type":282,"children":-1},"Astro","/docs/installation/astro","docs/installation/03.astro",{"title":292,"path":293,"stem":294,"new":18,"type":282,"children":-1},"Laravel","/docs/installation/laravel","docs/installation/04.laravel",{"title":296,"path":297,"stem":298,"new":18,"type":282,"children":-1},"Manual Installation","/docs/installation/manual","docs/installation/05.manual",{"title":300,"path":301,"stem":302,"children":303,"new":18,"type":272},"Dark Mode","/docs/dark-mode","docs/05.dark-mode",[304,307,310,314],{"title":279,"path":305,"stem":306,"new":18,"type":282,"children":-1},"/docs/dark-mode/vite","docs/dark-mode/01.vite",{"title":284,"path":308,"stem":309,"new":18,"type":282,"children":-1},"/docs/dark-mode/nuxt","docs/dark-mode/02.nuxt",{"title":311,"path":312,"stem":313,"new":18,"type":282,"children":-1},"Vitepress","/docs/dark-mode/vitepress","docs/dark-mode/03.vitepress",{"title":288,"path":315,"stem":316,"new":18,"type":282,"children":-1},"/docs/dark-mode/astro","docs/dark-mode/04.astro",{"title":318,"path":319,"stem":320,"children":321,"new":18,"type":272},"Forms","/docs/forms","docs/forms",[322,326],{"title":323,"path":324,"stem":325,"new":18,"type":282,"children":-1},"VeeValidate","/docs/forms/vee-validate","docs/forms/01.vee-validate",{"title":327,"path":328,"stem":329,"new":18,"type":282,"children":-1},"TanStack Form","/docs/forms/tanstack-form","docs/forms/02.tanstack-form",{"title":331,"path":332,"stem":333,"children":334,"new":18,"type":272},"Registry","/docs/registry","docs/registry/index",[335,336,340,344,348,352],{"title":331,"path":332,"stem":333,"new":18,"type":282,"children":-1},{"title":337,"path":338,"stem":339,"new":18,"type":282,"children":-1},"Examples","/docs/registry/examples","docs/registry/examples",{"title":341,"path":342,"stem":343,"new":18,"type":282,"children":-1},"FAQ","/docs/registry/faq","docs/registry/faq",{"title":345,"path":346,"stem":347,"new":18,"type":282,"children":-1},"Getting Started","/docs/registry/getting-started","docs/registry/getting-started",{"title":349,"path":350,"stem":351,"new":18,"type":282,"children":-1},"registry-item.json","/docs/registry/registry-item-json","docs/registry/registry-item-json",{"title":353,"path":354,"stem":355,"new":18,"type":282,"children":-1},"registry.json","/docs/registry/registry-json","docs/registry/registry-json",{"path":6,"stem":7,"title":357,"type":272,"children":358},"Get Started",[359,363,370,374,378,384,388,392,396,400],{"title":360,"path":361,"stem":362,"new":18,"type":282,"children":-1},"Introduction","/docs/introduction","docs/01.introduction",{"title":274,"path":275,"stem":276,"children":364,"new":18,"type":272},[365,366,367,368,369],{"title":279,"path":280,"stem":281,"new":18,"type":282,"children":-1},{"title":284,"path":285,"stem":286,"new":18,"type":282,"children":-1},{"title":288,"path":289,"stem":290,"new":18,"type":282,"children":-1},{"title":292,"path":293,"stem":294,"new":18,"type":282,"children":-1},{"title":296,"path":297,"stem":298,"new":18,"type":282,"children":-1},{"title":371,"path":372,"stem":373,"new":18,"type":282,"children":-1},"components.json","/docs/components-json","docs/03.components-json",{"title":375,"path":376,"stem":377,"new":18,"type":282,"children":-1},"Theming","/docs/theming","docs/04.theming",{"title":300,"path":301,"stem":302,"children":379,"new":18,"type":272},[380,381,382,383],{"title":279,"path":305,"stem":306,"new":18,"type":282,"children":-1},{"title":284,"path":308,"stem":309,"new":18,"type":282,"children":-1},{"title":311,"path":312,"stem":313,"new":18,"type":282,"children":-1},{"title":288,"path":315,"stem":316,"new":18,"type":282,"children":-1},{"title":385,"path":386,"stem":387,"new":18,"type":282,"children":-1},"CLI","/docs/cli","docs/06.cli",{"title":389,"path":390,"stem":391,"new":18,"type":282,"children":-1},"JavaScript","/docs/javascript","docs/07.javascript",{"title":393,"path":394,"stem":395,"new":18,"type":282,"children":-1},"Figma","/docs/figma","docs/09.figma",{"title":397,"path":398,"stem":399,"new":18,"type":282,"children":-1},"Changelog","/docs/changelog","docs/10.changelog",{"title":401,"path":402,"stem":403,"new":18,"type":282,"children":-1},"Legacy Docs","/docs/legacy","docs/11.legacy",{"repo":405},{"id":406,"name":407,"repo":408,"description":409,"createdAt":410,"updatedAt":411,"pushedAt":412,"stars":413,"watchers":414,"forks":415,"defaultBranch":416},658791894,"shadcn-vue","unovue/shadcn-vue","Vue port of shadcn-ui","2023-06-26T13:53:23Z","2026-04-14T10:18:37Z","2026-04-13T06:37:16Z",9755,38,638,"dev",{"id":418,"title":345,"body":419,"description":936,"extension":937,"links":938,"meta":939,"navigation":940,"new":18,"path":346,"rawbody":941,"seo":942,"stem":347,"__hash__":943},"content/docs/registry/getting-started.md",{"type":420,"value":421,"toc":915},"minimark",[422,426,429,433,443,451,485,489,634,638,724,728,735,741,751,755,758,762,767,777,788,792,796,799,895,899,909],[423,424,425],"p",{},"This guide will walk you through the process of setting up your own component registry.",[423,427,428],{},"It assumes you already have a project with components and would like to turn it into a registry.",[430,431,353],"h2",{"id":432},"registryjson",[423,434,435,436,439,440,442],{},"The ",[437,438,353],"code",{}," file is only required if you're using the ",[437,441,407],{}," CLI to build your registry.",[423,444,445,446,450],{},"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 ",[447,448,449],"a",{"href":350},"registry-item schema specification",".",[452,453,454,459,465,476],"steps",{},[455,456,458],"h3",{"id":457},"add-a-registryjson-file","Add a registry.json file",[423,460,461,462,464],{},"Create a ",[437,463,353],{}," file in the root of your project. Your project can be a Nuxt, Vite, or any other project that supports Vue.",[466,467,473],"pre",{"className":468,"code":470,"language":471,"meta":472},[469],"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\"",[437,474,470],{"__ignoreMap":475},"",[423,477,478,479,481,482,450],{},"This ",[437,480,353],{}," file must conform to the ",[447,483,484],{"href":354},"registry schema specification",[430,486,488],{"id":487},"add-a-registry-item","Add a registry item",[452,490,491,495,502,511,534,542,565,569,574,593,613,628],{},[455,492,494],{"id":493},"create-your-component","Create your component",[423,496,497,498,501],{},"Add your first component. Here's an example of a simple ",[437,499,500],{},"\u003CHelloWorld />"," component:",[466,503,509],{"className":504,"code":506,"language":507,"meta":508},[505],"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\"",[437,510,506],{"__ignoreMap":475},[512,513,516],"callout",{"className":514},[515],"mt-6",[423,517,518,522,523,526,527,529,530,533],{},[519,520,521],"strong",{},"Note:"," This example places the component in the ",[437,524,525],{},"registry/new-york","\ndirectory. You can place it anywhere in your project as long as you set the\ncorrect path in the ",[437,528,353],{}," file and you follow the ",[437,531,532],{},"registry/[NAME]","\ndirectory structure.",[466,535,540],{"className":536,"code":538,"language":539,"meta":475},[537],"language-txt","registry\n└── new-york\n    └── HelloWorld\n        └── HelloWorld.vue\n","txt",[437,541,538],{"__ignoreMap":475},[512,543,546,556],{"className":544},[515,545],"[&_pre]:mb-0",[423,547,548,551,552,555],{},[519,549,550],{},"Important:"," If you're placing your component in a custom directory, make\nsure it is configured in your ",[437,553,554],{},"tailwind.config.ts"," file.",[466,557,563],{"className":558,"code":560,"language":561,"meta":562},[559],"language-ts","// tailwind.config.ts\nexport default {\n  content: [\"./registry/**/*.{js,ts,jsx,tsx,vue}\"],\n}\n","ts","showLineNumbers",[437,564,560],{"__ignoreMap":475},[455,566,568],{"id":567},"add-your-component-to-the-registry","Add your component to the registry",[423,570,571,572,450],{},"To add your component to the registry, you need to add your component definition to ",[437,573,353],{},[466,575,591],{"className":576,"code":577,"highlights":578,"language":471,"meta":472},[469],"{\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",[579,580,581,582,583,584,585,586,587,588,589,590],6,7,8,9,10,11,12,13,14,15,16,17,[437,592,577],{"__ignoreMap":475},[423,594,595,596,599,600,599,603,599,606,609,610,450],{},"You define your registry item by adding a ",[437,597,598],{},"name",", ",[437,601,602],{},"type",[437,604,605],{},"title",[437,607,608],{},"description"," and ",[437,611,612],{},"files",[423,614,615,616,609,619,621,622,624,625,627],{},"For every file you add, you must specify the ",[437,617,618],{},"path",[437,620,602],{}," of the file. The ",[437,623,618],{}," is the relative path to the file from the root of your project. The ",[437,626,602],{}," is the type of the file.",[423,629,630,631,450],{},"You can read more about the registry item schema and file types in the ",[447,632,633],{"href":350},"registry item schema docs",[430,635,637],{"id":636},"build-your-registry","Build your registry",[452,639,640,644,655,663,667,677,684,688,691,697],{},[455,641,643],{"id":642},"install-the-shadcn-vue-cli","Install the shadcn-vue CLI",[423,645,646,647,650,651,654],{},"Note: the ",[437,648,649],{},"build"," command is currently only available in the ",[437,652,653],{},"shadcn-vue@canary"," version of the CLI.",[466,656,661],{"className":657,"code":659,"language":660,"meta":475},[658],"language-bash","npm install shadcn-vue@latest\n","bash",[437,662,659],{"__ignoreMap":475},[455,664,666],{"id":665},"add-a-build-script","Add a build script",[423,668,669,670,673,674,555],{},"Add a ",[437,671,672],{},"registry:build"," script to your ",[437,675,676],{},"package.json",[466,678,682],{"className":679,"code":680,"language":471,"meta":681},[469],"{\n  \"scripts\": {\n    \"registry:build\": \"shadcn-vue build\"\n  }\n}\n","showLineNumbers title=\"package.json\"",[437,683,680],{"__ignoreMap":475},[455,685,687],{"id":686},"run-the-build-script","Run the build script",[423,689,690],{},"Run the build script to generate the registry JSON files.",[466,692,695],{"className":693,"code":694,"language":660,"meta":475},[658],"npm run registry:build\n",[437,696,694],{"__ignoreMap":475},[512,698,700,712],{"className":699},[515],[423,701,702,704,705,708,709,450],{},[519,703,521],{}," By default, the build script will generate the registry JSON files in ",[437,706,707],{},"public/r"," e.g ",[437,710,711],{},"public/r/hello-world.json",[423,713,714,715,718,719,723],{},"You can change the output directory by passing the ",[437,716,717],{},"--output"," option. See the ",[447,720,722],{"href":721},"/docs/cli#build","shadcn-vue build command"," for more information.",[430,725,727],{"id":726},"serve-your-registry","Serve your registry",[423,729,730,731,734],{},"If you're running your registry on Nuxt, you can now serve your registry by running the ",[437,732,733],{},"nuxt"," server. The command might differ for other frameworks.",[466,736,739],{"className":737,"code":738,"language":660,"meta":475},[658],"npm run dev\n",[437,740,738],{"__ignoreMap":475},[423,742,743,744,747,748,450],{},"Your files will now be served at ",[437,745,746],{},"http://localhost:3000/r/[NAME].json"," eg. ",[437,749,750],{},"http://localhost:3000/r/hello-world.json",[430,752,754],{"id":753},"publish-your-registry","Publish your registry",[423,756,757],{},"To make your registry available to other developers, you can publish it by deploying your project to a public URL.",[430,759,761],{"id":760},"adding-auth","Adding Auth",[423,763,435,764,766],{},[437,765,407],{}," CLI does not offer a built-in way to add auth to your registry. We recommend handling authorization on your registry server.",[423,768,769,770,773,774,450],{},"A common simple approach is to use a ",[437,771,772],{},"token"," query parameter to authenticate requests to your registry. e.g. ",[437,775,776],{},"http://localhost:3000/r/hello-world.json?token=[SECURE_TOKEN_HERE]",[423,778,779,780,783,784,787],{},"Use the secure token to authenticate requests and return a 401 Unauthorized response if the token is invalid. Both the ",[437,781,782],{},"shadcn"," CLI and ",[437,785,786],{},"Open in v0"," will handle the 401 response and display a message to the user.",[512,789,791],{"className":790},[515],"\n  **Note:** Make sure to encrypt and expire tokens.\n",[430,793,795],{"id":794},"guidelines","Guidelines",[423,797,798],{},"Here are some guidelines to follow when building components for a registry.",[800,801,802,818,829,849,870,882],"ul",{},[803,804,805,806,809,810,813,814,817],"li",{},"Place your registry item in the ",[437,807,808],{},"registry/[STYLE]/[NAME]"," directory. I'm using ",[437,811,812],{},"new-york"," as an example. It can be anything you want as long as it's nested under the ",[437,815,816],{},"registry"," directory.",[803,819,820,821,599,823,599,825,609,827,450],{},"The following properties are required for the block definition: ",[437,822,598],{},[437,824,608],{},[437,826,602],{},[437,828,612],{},[803,830,831,832,835,836,599,839,599,842,845,846,450],{},"Make sure to list all registry dependencies in ",[437,833,834],{},"registryDependencies",". A registry dependency is the name of the component in the registry eg. ",[437,837,838],{},"input",[437,840,841],{},"button",[437,843,844],{},"card",", etc or a URL to a registry item eg. ",[437,847,848],{},"http://localhost:3000/r/editor.json",[803,850,851,852,855,856,599,859,862,863,866,867,450],{},"Make sure to list all dependencies in ",[437,853,854],{},"dependencies",". A dependency is the name of the package in the registry eg. ",[437,857,858],{},"zod",[437,860,861],{},"sonner",", etc. To set a version, you can use the ",[437,864,865],{},"name@version"," format eg. ",[437,868,869],{},"zod@^3.20.0",[803,871,872,747,879],{},[519,873,874,875,878],{},"Imports should always use the ",[437,876,877],{},"@/registry"," path.",[437,880,881],{},"import { HelloWorld } from \"@/registry/new-york/hello-world/hello-world\"",[803,883,884,885,599,888,599,891,894],{},"Ideally, place your files within a registry item in ",[437,886,887],{},"components",[437,889,890],{},"hooks",[437,892,893],{},"lib"," directories.",[430,896,898],{"id":897},"install-using-the-cli","Install using the CLI",[423,900,901,902,904,905,908],{},"To install a registry item using the ",[437,903,407],{}," CLI, use the ",[437,906,907],{},"add"," command followed by the URL of the registry item.",[466,910,913],{"className":911,"code":912,"language":660,"meta":475},[658],"npx shadcn-vue@latest add http://localhost:3000/r/hello-world.json\n",[437,914,912],{"__ignoreMap":475},{"title":475,"searchDepth":916,"depth":916,"links":917},2,[918,922,926,931,932,933,934,935],{"id":432,"depth":916,"text":353,"children":919},[920],{"id":457,"depth":921,"text":458},3,{"id":487,"depth":916,"text":488,"children":923},[924,925],{"id":493,"depth":921,"text":494},{"id":567,"depth":921,"text":568},{"id":636,"depth":916,"text":637,"children":927},[928,929,930],{"id":642,"depth":921,"text":643},{"id":665,"depth":921,"text":666},{"id":686,"depth":921,"text":687},{"id":726,"depth":916,"text":727},{"id":753,"depth":916,"text":754},{"id":760,"depth":916,"text":761},{"id":794,"depth":916,"text":795},{"id":897,"depth":916,"text":898},"Learn how to get setup and run your own component registry.","md",null,{},true,"---\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":345,"description":936},"kVXFewyrz4_Gd59HD7pa2YC_f2kJzXF4beMjxOX8MYI",[945,946],{"title":341,"path":342,"stem":343,"children":-1},{"title":349,"path":350,"stem":351,"children":-1},1776258656648]