Component API

<gallery-item>

Open live example

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

PropertyAttributeTypeDefaultDescription
srcsrcstring""URL of the fallback image.
altaltstring""Required alternative text for the image.
captioncaptionstring | undefined-Optional visible caption rendered below the image.
variantsJS property onlyGalleryItemVariant[]-Responsive source variants declared inside this item. read-only

Events

None.

Slots

SlotDescription
(default)Optional gallery-item-variant responsive image sources.

CSS custom properties

None.