sy / photoswipe
Photoswipe web component
Installs: 48
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: >=5.6.0
- sy/webcomponent: ^2
This package is auto-updated.
Last update: 2024-11-30 01:51:03 UTC
README
Photoswipe gallery web component using PhotoSwipe v4
Installation
$ composer require sy/photoswipe
Basic Usage
On the php side, add the component:
$this->setComponent('PHOTOSWIPE', new \Sy\Component\Web\PhotoSwipe());
On the template file, don't forget to add a slot {PHOTOSWIPE}
On the html side, put images on a container with the class "photoswipe-gallery":
<div class="photoswipe-gallery"> <img src="https://picsum.photos/id/1/400/300" alt="Image 1" /> <img src="https://picsum.photos/id/2/400/300" alt="Image 2" /> <img src="https://picsum.photos/id/3/400/300" alt="Image 3" /> <img src="https://picsum.photos/id/4/400/300" alt="Image 4"/> <img src="https://picsum.photos/id/5/400/300" alt="Image 5" /> </div>
You can try to run an example of how to use this component.