Ir al contenido

co-lightbox

Visor de imágenes a pantalla completa con scrim oscuro, zoom (rueda, botones o doble clic), arrastre para desplazar y carrusel cuando hay más de una imagen. Se controla como co-modal: el host es dueño de open y reacciona a coClose. Las imágenes se pasan como un array JSON en images.

Ver código
<co-lightbox locale="es" images='[{"src":"https://picsum.photos/seed/a/1200/800","alt":"Imagen 1"},{"src":"https://picsum.photos/seed/b/900/1200","alt":"Imagen 2"}]'></co-lightbox>

Props

PropAtributoTipoDefaultDescripción
imagesimagesstring'[]'JSON array of {@link LightboxImage} (controlled by the host).
localelocalestring | undefinedBCP-47 locale for the built-in aria strings (es/en/pt).
openopenbooleanfalseWhether the viewer is visible.
startIndexstart-indexnumber0Index shown when the viewer opens.

Eventos

EventoDetailBubblesCancelableDescripción
coChangenumberEmitted when the active image changes (prev/next/keyboard).
coClosevoidEmitted when the viewer requests to close (backdrop, X, Escape).

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(close)The close button
::part(counter)The "i / n" indicator
::part(image)The active image element
::part(next)Next-image arrow button
::part(overlay)Fullscreen scrim container
::part(prev)Previous-image arrow button
::part(toolbar)Top bar (caption + zoom controls + actions)

CSS Custom Properties

Este componente no expone CSS custom properties.