# Luna Gallery Lightweight gallery. ## Demo https://luna.liriliri.io/?path=/story/gallery ## Install Add the following script and style to your page. ```html ``` You can also get it on npm. ```bash npm install luna-gallery luna-toolbar luna-image-viewer luna-carousel --save ``` ```javascript import 'luna-carousel/luna-carousel.css' import 'luna-image-viewer/luna-image-viewer.css' import 'luna-toolbar/luna-toolbar.css' import 'luna-gallery/luna-gallery.css' import LunaGallery from 'luna-gallery' ``` ## Usage ```javascript const gallery = new LunaGallery(container) gallery.append('https://luna.liriliri.io/pic1.png', 'pic1.png') gallery.show() ``` ## Configuration * inline(boolean): Enable inline mode. ## Api ### append(src: string, title?: string): void Append image. ### clear(): void Clear all images. ### insert(pos: number, src: string, title?: string): void Insert image at given position. ### slideTo(idx: number): void Slide to the item at given index.