Carousel
Carousel component with scroll snap, swipe, arrows, dots and optional autoplay that pauses on hover.
How to use it
Run npx @blossomui/react add carousel, or copy src/components/UI/Carousel/Carousel.tsx into your React project and import it.
import { Carousel } from './components/ui/Carousel'Props
CarouselLabels
| Prop | Type | Description |
|---|---|---|
| carousel (required) | string | |
| previous (required) | string | |
| next (required) | string | |
| goTo (required) | (slide: number) => string | |
| slide (required) | (slide: number, total: number) => string |
CarouselProps
| Prop | Type | Description |
|---|---|---|
| labels | Partial<CarouselLabels> | Texts of the component. Pass only the ones you want to change, for example to translate it. |
| color | string | Accent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default. |
| slides (required) | ReactNode[] | Each item is one slide. |
| autoPlay | boolean | Move to the next slide every `interval` milliseconds. Pauses on hover and focus. |
| interval | number | |
| loop | boolean | Go back to the first slide after the last one. |
| dots | boolean | Show the dots that jump to a slide. |