Installation

Pick the way that suits your project. Nothing else needs to be installed.

npm

npm install @mozert-studio/mozert-slider
import Mozert from '@mozert-studio/mozert-slider';
import '@mozert-studio/mozert-slider/css';          // required layout styles
import '@mozert-studio/mozert-slider/theme.css';    // optional arrows and dots styling

const slider = new Mozert('.slider', { dots: true });

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mozert-studio/mozert-slider@1/dist/mozert.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mozert-studio/mozert-slider@1/dist/mozert-theme.min.css">
<script src="https://cdn.jsdelivr.net/npm/@mozert-studio/mozert-slider@1/dist/mozert.min.js"></script>
<script>new Mozert('.slider', { dots: true });</script>
The CDN URLs work after the package has been published to npm. Until then, copy the files from dist/.

Which file?

FileUse it for
mozert.min.jsDefault. Core and every module (effects, pagination types, free mode, zoom, virtual, and so on).
mozert.core.min.jsCore features only; smallest download.
mozert.esm.mjsES module for bundlers (import resolves to this automatically).
mozert.jquery.min.jsAdds $.fn.mozert.

Frameworks

Official packages for React and Vue 3. They create the slider after the component mounts, destroy it before the framework removes anything, and rebuild it when slides are added, removed or reordered, or an option changes. Import the slider CSS once.

npm install @mozert-studio/react @mozert-studio/mozert-slider

// root layout
import '@mozert-studio/mozert-slider/css';
import '@mozert-studio/mozert-slider/theme.css';

import MozertSlider from '@mozert-studio/react';

<MozertSlider slidesToShow={3} spaceBetween={16} dots thumbs lightbox onChange={(i) => console.log(i)}>
  {products.map((p) => <div key={p.id}><img src={p.image} alt={p.name} /></div>)}
</MozertSlider>

// Every Mozert option works as a prop (or inside options={{ ... }}).
// Each child renders one element. Give children a key.
// onInit(slider), onChange(index, slider); a ref gives { slider, element }.

Verify

Open the console and run Mozert.version; it should print 1.1.1. Check Mozert.get(el) to get an instance back from an element.