Skip to content

Carousel

A CSS scroll-snap carousel using only Tailwind classes (no JS).

Example
Example
Example
Example
Example
Terminal window
bunx bejamas add carousel
---
import Carousel from '@/components/ui/Carousel.astro';
---
<Carousel>
<!-- Slides rendered via part="slide"; give inner content widths (e.g., w-64) -->
<Carousel part="slide"><div class="w-72 bg-muted rounded-xl p-6">Item 1</div></Carousel>
<Carousel part="slide"><div class="w-72 bg-muted rounded-xl p-6">Item 2</div></Carousel>
<Carousel part="slide"><div class="w-72 bg-muted rounded-xl p-6">Item 3</div></Carousel>
</Carousel>
A
B
C
D
E
Item 1
Item 2
Item 3
Item 4
Built at Bejamas