Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Data Display

carousel

Horizontally scrolling slides with snap points and arrow controls.

1
2
3
4
5

Installation

php artisan ui:add carousel

Usage

<x-ui.carousel class="w-full max-w-xs">
    @foreach ($slides as $slide)
        {{-- basis-full by default; use class="basis-1/2" for a multi-up row. --}}
        <x-ui.carousel.item>
            <x-ui.card>{{ $slide }}</x-ui.card>
        </x-ui.carousel.item>
    @endforeach
</x-ui.carousel>

CSS scroll-snap does the scrolling; the inline <script> only drives the two arrow buttons, and no JS dependencies. Items are basis-full by default, override with class for a multi-up layout.

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([])