--- import DefaultLayout from '@shared/layouts/DefaultLayout.astro' import Card from '@ui/Card.astro' import CardBody from '@ui/CardBody.astro' import CardTitle from '@ui/CardTitle.astro' import CardSubtitle from '@ui/CardSubtitle.astro' import DocsLink from '@ui/DocsLink.astro' import HoverGallery from '@ui/HoverGallery.astro' import photos from '@data/photos.json' import { staticPath } from '@shared/lib/assets' const backpack = ['Black leather backpack, front view', 'Black leather backpack, view from the front left', 'Black leather backpack, side view', 'Black leather backpack, back view with the shoulder straps', 'Brass buckle and leather grain of the backpack'].map((alt, index) => ({ src: staticPath(`products/backpack-${index + 1}.jpg`), alt, })) const watch = ['Steel watch with a black dial, front view', 'Steel watch with a black dial, view from the front left', 'Steel watch, side view with the crown', 'Steel watch, back view with the case back and buckle', 'Close-up of the watch dial, bezel and crown'].map((alt, index) => ({ src: staticPath(`products/watch-${index + 1}.jpg`), alt, })) const landscapeFiles = ['blue-sofa-with-pillows-in-a-designer-living-room-interior.jpg', 'city-lights-reflected-in-the-water-at-night.jpg', 'colorful-exotic-flowers-and-greenery.jpg'] const landscapes = photos.filter((photo) => landscapeFiles.includes(photo.file)).map((photo) => ({ src: staticPath(`photos/${photo.file}`), alt: photo.title })) ---
Basic Wrap each image in .hover-gallery-item; every item is one hover column.
With indicators Add .hover-gallery-indicators to show which image is on display.
Aspect ratio Set --tblr-hover-gallery-aspect-ratio to change the shape.
Product card Use the gallery with .card-img-top in place of the card image.
$189