diff --git a/apps/www/src/content/docs/components/carousel.md b/apps/www/src/content/docs/components/carousel.md index a8ac4332..b758c24f 100644 --- a/apps/www/src/content/docs/components/carousel.md +++ b/apps/www/src/content/docs/components/carousel.md @@ -1,8 +1,14 @@ --- -## title: Carousel description: A carousel with motion and swipe built using Embla. source: apps/www/src/lib/registry/default/ui/carousel primitive: +``` +--- +title: Carousel +description: A carousel with motion and swipe built using Embla. +source: apps/www/src/lib/registry/default/ui/carousel +primitive: https://www.embla-carousel.com/api +--- -<ComponentPreview name="CarouselDemo" /> + ## About @@ -21,6 +27,7 @@ npx shadcn-vue@latest add carousel import { Carousel, CarouselContent, + CarouselDotButtons, CarouselItem, CarouselNext, CarouselPrevious, @@ -47,11 +54,11 @@ import { To set the size of the items, you can use the `basis` utility class on the ``. -<ComponentPreview name="CarouselSize" /> + Example -```vue:line-numbers +```vue:line-numbers title="Example" {4-6} // 33% of the carousel width. @@ -64,7 +71,7 @@ Example Responsive -```vue:line-numbers +```vue:line-numbers title="Responsive" {4-6} // 50% on small screens and 33% on larger screens. @@ -79,17 +86,22 @@ Responsive To set the spacing between the items, we use a `pl-[VALUE]` utility on the `` and a negative `-ml-[VALUE]` on the ``. -<Callout class="mt-6"> + -**Why:** I tried to use the `gap` property or a `grid` layout on the `CarouselContent` but it required a lot of math and mental effort to get the spacing right. I found `pl-[VALUE]` and `-ml-[VALUE]` utilities much easier to use. <br/><br/> You can always adjust this in your own project if you need to. +**Why:** I tried to use the `gap` property or a `grid` layout on the ` +CarouselContent` but it required a lot of math and mental effort to get the +spacing right. I found `pl-[VALUE]` and `-ml-[VALUE]` utilities much easier to +use. +

+You can always adjust this in your own project if you need to. -</Callout> +
-<ComponentPreview name="CarouselSpacing" /> + Example -```vue:line-numbers +```vue:line-numbers /-ml-4/ /pl-4/