Download the PHP package tuto1902/carousel without Composer
On this page you can find all versions of the php package tuto1902/carousel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tuto1902/carousel
More information about tuto1902/carousel
Files in tuto1902/carousel
Package carousel
Short Description Embla carousel wrapper for Laravel
License MIT
Homepage https://github.com/tuto1902/carousel
Informations about the package carousel
Embla carousel wrapper for Laravel
This pacakge provides a blade component wrapper for the Embla Carousel component. It allows you to incorporate a carousel component on any Laravel project by using a simple blade component and providing configuration properties to fit your specific needs.
Requirements
- PHP 8.2+
- Laravel v10.0+
- TailwindCSS 3.4+
- AlpineJS 3.14+
Installation
You can install the package via composer:
Add the following line to resources\js\app.js
. Make sure to add this line at the beginning of the file, or at least before AlpineJS is initialized.
Add the following line to tailwind.config.js
inside the content section
Then, compile all your assets using Vite
Optionally, you can publish the views using
Usage
To get started, you can create a simple view using
It's recommended to use a layout component so that all pages share the same boilerplate code. You can create a new layout component using
This will create two files:
- app\View\Components\AppLayout.php
- resources\views\components\app-layout.php
Replace the content of app-layout.blade.php
with the common HTML boilerplate to be shared among all views. Here's an example of a simple layout file.
You can combine all components provided in this package to assemble your own caruosel. Here's an example. If you published the views using php artisan vendor:publish
, you don't need to include the view namespace x-carousel::
and you can simply use <x-carousel>
instead. Add this content to the view we created earlier
Finally, create a new route to see your new carousel in action.
You can include any of the following parameters to further customize the looks and feel of the carousel. For example, using the loop
parameter, the carousel will loop around after reaching the last/first slide.
Here's a list of all available properties
Property | Accepted Values | Description |
---|---|---|
loop | true/false | Loop back whean reaching the last/first slide |
orientation | horizontal/vertical | Changes the carousel orientation |
autoplay | true/false | When enabled, slides will autoplay after a delay |
delay | number | Controls the delay of the carousel autoplay in miliseconds. Default is 4000 (4 seconds) |
size | string | Controls the size of the carousel. You can use any valid Tailwind CSS class. Default value is size-96 . See Tailwind CSS Documentation for all possible values. |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of carousel with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0