Options

Available options


GLightbox is a beautful lightbox library written using TypeScript. It has plugins support and it’s completely modular meaning you add the plugins your project needs. There’s plugins to display images, iframes, inline content, videos and each plugin has it’s own configuration.

💡

This options are used to configure only the lightbox instance, each plugin has it’s own options so make sure you also read the plugins section to learn how to configure install and configure plugins.

Options

OptionTypeDefaultDescription
pluginsarraynullList of plugins to use.
itemsarraynullInstead of passing a selector you can pass all the items that you want in the gallery.
dataAttributesPrefixstringnullAdd a prefix to data attributes, so instead of adding a data-title attribute you could use data-myprefix-title
autoGallerybooleantrueIf true all the items with attribute data-glightbox selector will open in a gallery, if set to false items will open individually.
closeOnOutsideClickbooleantrueClose the lightbox when clicking outside the active slide.
startAtnumber0Open lightbox at defined index.
appearanceAppearanceOptionsConfigure the lightbox appearance

Appearance Options

OptionTypeDefaultDescription
themestringcleanName of the theme you want to use
slideEffectstringfadeAnimation to use on slide change
openEffectstringzoomAnimation to use on slide open
lightboxHTMLstringnullYou can adjust completely the HTML structure of the lightbox
slideHTMLstringnullYou can adjust completely the HTML structure of the slide
svg{next: "", prev: "", loader: ""}nullYou can adjust completely the SVG icons