Component API
<gallery-item>
Declarative image metadata consumed by a parent photo-gallery.
Install
import "@f-ewald/components/gallery-item.js";
Usage
<gallery-item
src="/photos/coast.jpg"
alt="Rocky California coastline"
caption="California coast"
>
<gallery-item-variant
media="(max-width: 640px)"
srcset="/photos/coast-portrait.jpg"
></gallery-item-variant>
</gallery-item>
Attributes / properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
src | src | string | "" | URL of the fallback image. |
alt | alt | string | "" | Required alternative text for the image. |
caption | caption | string | undefined | - | Optional visible caption rendered below the image. |
variants | JS property only | GalleryItemVariant[] | - | Responsive source variants declared inside this item. read-only |
Events
None.
Slots
| Slot | Description |
|---|---|
(default) | Optional gallery-item-variant responsive image sources. |
CSS custom properties
None.