[{"data":1,"prerenderedAt":830},["ShallowReactive",2],{"navigation":3,"$fMW9jOOkNpZriWVK3P_bZYNOyYR2IEPvrHsC7cDBlJJc":405,"/docs/components/carousel":418,"surround-/docs/components/carousel":827},[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":142,"body":420,"description":820,"extension":821,"links":822,"meta":823,"navigation":132,"new":17,"path":143,"rawbody":824,"seo":825,"stem":144,"__hash__":826},"content/docs/components/carousel.md",{"type":421,"value":422,"toc":803},"minimark",[423,428,432,500,504,513,516,521,532,536,546,553,557,574,607,611,618,625,629,635,639,645,649,662,671,675,679,689,693,697,703,712,716,725,735,743,747,762,769,773,779,785,792,796],[424,425],"component-preview",{"description":426,"name":427,"title":142},"A carousel component.","CarouselDemo",[429,430,20],"h2",{"id":431},"installation",[433,434,435,451,465],"code-tabs",{},[436,437,438,445],"tabs-list",{},[439,440,442],"tabs-trigger",{"value":441},"cli",[443,444,71],"p",{},[439,446,448],{"value":447},"manual",[443,449,450],{},"Manual",[452,453,454],"tabs-content",{"value":441},[455,456,462],"pre",{"className":457,"code":459,"language":460,"meta":461},[458],"language-bash","npx shadcn-vue@latest add carousel\n","bash","",[463,464,459],"code",{"__ignoreMap":461},[452,466,467],{"value":447},[468,469,470,476,482,495],"steps",{},[471,472,473],"step",{},[443,474,475],{},"Install the following dependencies:",[455,477,480],{"className":478,"code":479,"language":460,"meta":461},[458],"npm install embla-carousel-vue\n",[463,481,479],{"__ignoreMap":461},[471,483,484],{},[443,485,486,487,494],{},"Copy and paste the ",[488,489,493],"a",{"href":490,"rel":491},"https://github.com/unovue/shadcn-vue/tree/dev/apps/v4/registry/new-york-v4/ui/carousel",[492],"nofollow","GitHub source code"," into your project.",[471,496,497],{},[443,498,499],{},"Update the import paths to match your project setup.",[429,501,503],{"id":502},"usage","Usage",[455,505,511],{"className":506,"code":508,"language":509,"meta":510},[507],"language-vue","\u003Cscript setup lang=\"ts\">\nimport {\n  Carousel,\n  CarouselContent,\n  CarouselItem,\n  CarouselNext,\n  CarouselPrevious,\n} from '@/components/ui/carousel'\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n    \u003C/CarouselContent>\n    \u003CCarouselPrevious />\n    \u003CCarouselNext />\n  \u003C/Carousel>\n\u003C/template>\n","vue","showLineNumbers",[463,512,508],{"__ignoreMap":461},[429,514,386],{"id":515},"examples",[517,518,520],"h3",{"id":519},"sizes","Sizes",[443,522,523,524,527,528,531],{},"To set the size of the items, you can use the ",[463,525,526],{},"basis"," utility class on the ",[463,529,530],{},"\u003CCarouselItem />",".",[424,533],{"description":534,"name":535,"title":142},"A carousel with 3 active items of equal size.","CarouselSize",[455,537,544],{"className":538,"code":539,"highlights":540,"language":509,"meta":510},[507],"// 33% of the carousel width.\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n",[541,542,543],5,6,7,[463,545,539],{"__ignoreMap":461},[455,547,551],{"className":548,"code":549,"highlights":550,"language":509,"meta":510},[507],"// 50% on small screens and 33% on larger screens.\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n",[541,542,543],[463,552,549],{"__ignoreMap":461},[517,554,556],{"id":555},"spacing","Spacing",[443,558,559,560,563,564,566,567,570,571,531],{},"To set the spacing between the items, we use a ",[463,561,562],{},"pl-[VALUE]"," utility on the ",[463,565,530],{}," and a negative ",[463,568,569],{},"-ml-[VALUE]"," on the ",[463,572,573],{},"\u003CCarouselContent />",[575,576,579,604],"callout",{"className":577},[578],"mt-6",[443,580,581,585,586,589,590,593,594,597,598,600,601,603],{},[582,583,584],"strong",{},"Why:"," I tried to use the ",[463,587,588],{},"gap"," property or a ",[463,591,592],{},"grid"," layout on the ",[463,595,596],{},"   \u003CCarouselContent />"," but it required a lot of math and mental effort to get the\nspacing right. I found ",[463,599,562],{}," and ",[463,602,569],{}," utilities much easier to\nuse.",[443,605,606],{},"You can always adjust this in your own project if you need to.",[424,608],{"description":609,"name":610,"title":142},"A carousel with 3 items with a spacing of 1rem.","CarouselSpacing",[455,612,616],{"className":613,"code":614,"language":509,"meta":615},[507],"\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent class=\"-ml-4\">\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n","showLineNumbers /-ml-4/ /pl-4/",[463,617,614],{"__ignoreMap":461},[455,619,623],{"className":620,"code":621,"language":509,"meta":622},[507],"\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent class=\"-ml-2 md:-ml-4\">\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n","showLineNumbers /-ml-2/ /pl-2/ /md:-ml-4/ /md:pl-4/",[463,624,621],{"__ignoreMap":461},[517,626,628],{"id":627},"orientation","Orientation",[443,630,631,632,634],{},"Use the ",[463,633,627],{}," prop to set the orientation of the carousel.",[424,636],{"description":637,"name":638,"title":142},"A vertical carousel.","CarouselOrientation",[455,640,643],{"className":641,"code":642,"language":509,"meta":461},[507],"\u003CCarousel orientation=\"vertical | horizontal\">\n  ...\n\u003C/Carousel>\n",[463,644,642],{"__ignoreMap":461},[429,646,648],{"id":647},"options","Options",[443,650,651,652,655,656,661],{},"You can pass options to the carousel using the ",[463,653,654],{},"opts"," prop. See the ",[488,657,660],{"href":658,"rel":659},"https://www.embla-carousel.com/api/options/",[492],"Embla Carousel docs"," for more information.",[455,663,669],{"className":664,"code":665,"highlights":666,"language":509,"meta":510},[507],"\u003Ctemplate>\n  \u003CCarousel\n    :opts=\"{\n      align: 'start',\n      loop: true,\n    }\"\n  >\n    \u003CCarouselContent>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n",[667,668,541,542],3,4,[463,670,665],{"__ignoreMap":461},[429,672,674],{"id":673},"api","API",[517,676,678],{"id":677},"method-1","Method 1",[443,680,631,681,684,685,688],{},[463,682,683],{},"@init-api"," emit method on ",[463,686,687],{},"\u003CCarousel />"," component to set the instance of the API.",[424,690],{"description":691,"name":692,"title":142},"A carousel with a slide counter.","CarouselApi",[517,694,696],{"id":695},"method-2","Method 2",[443,698,699,700,702],{},"You can access it through setting a template ref on the ",[463,701,687],{}," component.",[455,704,710],{"className":705,"code":706,"highlights":707,"language":509,"meta":510},[507],"\u003Cscript setup lang=\"ts\">\nconst carouselContainerRef = ref\u003CInstanceType\u003Ctypeof Carousel> | null>(null)\n\nfunction accessApi() {\n  carouselContainerRef.value?.carouselApi.on('select', () => {})\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel ref=\"carouselContainerRef\">\n    ...\n  \u003C/Carousel>\n\u003C/template>\n",[708,541,709],2,10,[463,711,706],{"__ignoreMap":461},[429,713,715],{"id":714},"events","Events",[443,717,718,719,721,722,724],{},"You can listen to events using the API. To get the API instance use the ",[463,720,683],{}," emit method on the ",[463,723,687],{}," component",[455,726,733],{"className":727,"code":728,"highlights":729,"language":509,"meta":510},[507],"\u003Cscript setup lang=\"ts\">\nimport { nextTick, ref, watch } from 'vue'\nimport { useCarousel } from '@/components/ui/carousel'\n\nconst api = ref\u003CCarouselApi>()\n\nfunction setApi(val: CarouselApi) {\n  api.value = val\n}\n\nconst stop = watch(api, (api) => {\n  if (!api)\n    return\n\n  // Watch only once or use watchOnce() in @vueuse/core\n  nextTick(() => stop())\n\n  api.on('select', () => {\n    // Do something on select.\n  })\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel @init-api=\"setApi\">\n    ...\n  \u003C/Carousel>\n\u003C/template>\n",[541,543,730,731,732],8,9,25,[463,734,728],{"__ignoreMap":461},[443,736,737,738,742],{},"See the ",[488,739,660],{"href":740,"rel":741},"https://www.embla-carousel.com/api/events/",[492]," for more information on using events.",[429,744,746],{"id":745},"slot-props","Slot Props",[443,748,749,750,753,754,757,758,761],{},"You can get the reactive slot props like ",[463,751,752],{},"carouselRef, canScrollNext..Prev, scrollNext..Prev"," using the ",[463,755,756],{},"v-slot"," directive in the ",[463,759,760],{},"\u003CCarousel v-slot=\"slotProps\" />"," component to extend the functionality.",[455,763,767],{"className":764,"code":765,"highlights":766,"language":509,"meta":510},[507],"\u003Ctemplate>\n  \u003CCarousel v-slot=\"{ canScrollNext, canScrollPrev }\">\n    ...\n    \u003CCarouselPrevious v-if=\"canScrollPrev\" />\n    \u003CCarouselNext v-if=\"canScrollNext\" />\n  \u003C/Carousel>\n\u003C/template>\n",[708],[463,768,765],{"__ignoreMap":461},[429,770,772],{"id":771},"plugins","Plugins",[443,774,775,776,778],{},"You can use the ",[463,777,771],{}," prop to add plugins to the carousel.",[455,780,783],{"className":781,"code":782,"language":460,"meta":461},[458],"npm install embla-carousel-autoplay\n",[463,784,782],{"__ignoreMap":461},[455,786,790],{"className":787,"code":788,"highlights":789,"language":509,"meta":510},[507],"\u003Cscript setup lang=\"ts\">\nimport Autoplay from 'embla-carousel-autoplay'\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel\n    class=\"w-full max-w-xs\"\n    :plugins=\"[Autoplay({\n      delay: 2000,\n    })]\"\n  >\n    ...\n  \u003C/Carousel>\n\u003C/template>\n",[708,730,731,709],[463,791,788],{"__ignoreMap":461},[424,793],{"description":794,"name":795,"title":142},"A carousel with the autoplay plugin.","CarouselPlugin",[443,797,737,798,802],{},[488,799,660],{"href":800,"rel":801},"https://www.embla-carousel.com/api/plugins/",[492]," for more information on using plugins.",{"title":461,"searchDepth":708,"depth":708,"links":804},[805,806,807,812,813,817,818,819],{"id":431,"depth":708,"text":20},{"id":502,"depth":708,"text":503},{"id":515,"depth":708,"text":386,"children":808},[809,810,811],{"id":519,"depth":667,"text":520},{"id":555,"depth":667,"text":556},{"id":627,"depth":667,"text":628},{"id":647,"depth":708,"text":648},{"id":673,"depth":708,"text":674,"children":814},[815,816],{"id":677,"depth":667,"text":678},{"id":695,"depth":667,"text":696},{"id":714,"depth":708,"text":715},{"id":745,"depth":708,"text":746},{"id":771,"depth":708,"text":772},"A carousel with motion and swipe built using Embla.","md",null,{"component":132},"---\ntitle: Carousel\ndescription: A carousel with motion and swipe built using Embla.\ncomponent: true\n---\n\n::component-preview\n---\nname: CarouselDemo\ntitle: Carousel\ndescription: A carousel component.\n---\n::\n\n## Installation\n\n::code-tabs\n\n::tabs-list\n\n  ::tabs-trigger{value=\"cli\"}\n  CLI\n  ::\n\n  ::tabs-trigger{value=\"manual\"}\n  Manual\n  ::\n\n::\n\n::tabs-content{value=\"cli\"}\n\n```bash\nnpx shadcn-vue@latest add carousel\n```\n\n::\n\n::tabs-content{value=\"manual\"}\n  ::steps\n    ::step\n    Install the following dependencies:\n    ::\n\n    ```bash\n    npm install embla-carousel-vue\n    ```\n\n    ::step\n    Copy and paste the [GitHub source code](https://github.com/unovue/shadcn-vue/tree/dev/apps/v4/registry/new-york-v4/ui/carousel) into your project.\n    ::\n\n    ::step\n    Update the import paths to match your project setup.\n    ::\n  ::\n::\n\n::\n\n## Usage\n\n```vue showLineNumbers\n\u003Cscript setup lang=\"ts\">\nimport {\n  Carousel,\n  CarouselContent,\n  CarouselItem,\n  CarouselNext,\n  CarouselPrevious,\n} from '@/components/ui/carousel'\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n    \u003C/CarouselContent>\n    \u003CCarouselPrevious />\n    \u003CCarouselNext />\n  \u003C/Carousel>\n\u003C/template>\n```\n\n## Examples\n\n### Sizes\n\nTo set the size of the items, you can use the `basis` utility class on the `\u003CCarouselItem />`.\n\n::component-preview\n---\nname: CarouselSize\ntitle: Carousel\ndescription: A carousel with 3 active items of equal size.\n---\n::\n\n```vue showLineNumbers {5-7}\n// 33% of the carousel width.\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n```\n\n```vue showLineNumbers {5-7}\n// 50% on small screens and 33% on larger screens.\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"md:basis-1/2 lg:basis-1/3\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n```\n\n### Spacing\n\nTo set the spacing between the items, we use a `pl-[VALUE]` utility on the `\u003CCarouselItem />` and a negative `-ml-[VALUE]` on the `\u003CCarouselContent />`.\n\n::callout{class=\"mt-6\"}\n  **Why:** I tried to use the `gap` property or a `grid` layout on the `\n  \u003CCarouselContent />` but it required a lot of math and mental effort to get the\n  spacing right. I found `pl-[VALUE]` and `-ml-[VALUE]` utilities much easier to\n  use.\n\nYou can always adjust this in your own project if you need to.\n\n::\n\n::component-preview\n---\nname: CarouselSpacing\ntitle: Carousel\ndescription: A carousel with 3 items with a spacing of 1rem.\n---\n::\n\n```vue showLineNumbers /-ml-4/ /pl-4/\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent class=\"-ml-4\">\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-4\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n```\n\n```vue showLineNumbers /-ml-2/ /pl-2/ /md:-ml-4/ /md:pl-4/\n\u003Ctemplate>\n  \u003CCarousel>\n    \u003CCarouselContent class=\"-ml-2 md:-ml-4\">\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n      \u003CCarouselItem class=\"pl-2 md:pl-4\">\n        ...\n      \u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n```\n\n### Orientation\n\nUse the `orientation` prop to set the orientation of the carousel.\n\n::component-preview\n---\nname: CarouselOrientation\ntitle: Carousel\ndescription: A vertical carousel.\n---\n::\n\n```vue\n\u003CCarousel orientation=\"vertical | horizontal\">\n  ...\n\u003C/Carousel>\n```\n\n## Options\n\nYou can pass options to the carousel using the `opts` prop. See the [Embla Carousel docs](https://www.embla-carousel.com/api/options/) for more information.\n\n```vue showLineNumbers {3-6}\n\u003Ctemplate>\n  \u003CCarousel\n    :opts=\"{\n      align: 'start',\n      loop: true,\n    }\"\n  >\n    \u003CCarouselContent>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n      \u003CCarouselItem>...\u003C/CarouselItem>\n    \u003C/CarouselContent>\n  \u003C/Carousel>\n\u003C/template>\n```\n\n## API\n\n### Method 1\n\nUse the `@init-api` emit method on `\u003CCarousel />` component to set the instance of the API.\n\n::component-preview\n---\nname: CarouselApi\ntitle: Carousel\ndescription: A carousel with a slide counter.\n---\n::\n\n### Method 2\n\nYou can access it through setting a template ref on the `\u003CCarousel />` component.\n\n```vue showLineNumbers {2,5,10}\n\u003Cscript setup lang=\"ts\">\nconst carouselContainerRef = ref\u003CInstanceType\u003Ctypeof Carousel> | null>(null)\n\nfunction accessApi() {\n  carouselContainerRef.value?.carouselApi.on('select', () => {})\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel ref=\"carouselContainerRef\">\n    ...\n  \u003C/Carousel>\n\u003C/template>\n```\n\n## Events\n\nYou can listen to events using the API. To get the API instance use the `@init-api` emit method on the `\u003CCarousel />` component\n\n```vue showLineNumbers {5,7-9,25}\n\u003Cscript setup lang=\"ts\">\nimport { nextTick, ref, watch } from 'vue'\nimport { useCarousel } from '@/components/ui/carousel'\n\nconst api = ref\u003CCarouselApi>()\n\nfunction setApi(val: CarouselApi) {\n  api.value = val\n}\n\nconst stop = watch(api, (api) => {\n  if (!api)\n    return\n\n  // Watch only once or use watchOnce() in @vueuse/core\n  nextTick(() => stop())\n\n  api.on('select', () => {\n    // Do something on select.\n  })\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel @init-api=\"setApi\">\n    ...\n  \u003C/Carousel>\n\u003C/template>\n```\n\nSee the [Embla Carousel docs](https://www.embla-carousel.com/api/events/) for more information on using events.\n\n## Slot Props\n\nYou can get the reactive slot props like `carouselRef, canScrollNext..Prev, scrollNext..Prev` using the `v-slot` directive in the `\u003CCarousel v-slot=\"slotProps\" />` component to extend the functionality.\n\n```vue showLineNumbers {2}\n\u003Ctemplate>\n  \u003CCarousel v-slot=\"{ canScrollNext, canScrollPrev }\">\n    ...\n    \u003CCarouselPrevious v-if=\"canScrollPrev\" />\n    \u003CCarouselNext v-if=\"canScrollNext\" />\n  \u003C/Carousel>\n\u003C/template>\n```\n\n## Plugins\n\nYou can use the `plugins` prop to add plugins to the carousel.\n\n```bash\nnpm install embla-carousel-autoplay\n```\n\n```vue showLineNumbers {2,8-10}\n\u003Cscript setup lang=\"ts\">\nimport Autoplay from 'embla-carousel-autoplay'\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CCarousel\n    class=\"w-full max-w-xs\"\n    :plugins=\"[Autoplay({\n      delay: 2000,\n    })]\"\n  >\n    ...\n  \u003C/Carousel>\n\u003C/template>\n```\n\n::component-preview\n---\nname: CarouselPlugin\ntitle: Carousel\ndescription: A carousel with the autoplay plugin.\n---\n::\n\nSee the [Embla Carousel docs](https://www.embla-carousel.com/api/plugins/) for more information on using plugins.\n",{"title":142,"description":820},"cj72sqobGaDRv4v-Wsjv1i6be1Rj4_S48fhC-vbZrao",[828,829],{"title":138,"path":139,"stem":140,"children":-1},{"title":146,"path":147,"stem":148,"children":-1},1775649982870]