Installation
Add Blaze Slider to your project via NPM or CDN
NPM
npm install blaze-sliderThen import the library and its styles:
import BlazeSlider from 'blaze-slider';
import 'blaze-slider/dist/blaze.css';The CSS import is required. The slider won't render correctly without it.
View npm example on CodeSandbox →
CDN
Add the script and stylesheet directly to your HTML:
<link
rel="stylesheet"
href="https://unpkg.com/blaze-slider@latest/dist/blaze.css"
/>
<script src="https://unpkg.com/blaze-slider@latest/dist/blaze-slider.min.js"></script>This exposes a global BlazeSlider constructor:
<script>
new BlazeSlider(document.querySelector('.blaze-slider'));
</script>View CDN example on CodeSandbox →
Available builds
| Build | URL |
|---|---|
| Production | https://unpkg.com/blaze-slider@latest/dist/blaze-slider.min.js |
| Development | https://unpkg.com/blaze-slider@latest/dist/blaze-slider.dev.js |
| CSS | https://unpkg.com/blaze-slider@latest/dist/blaze.css |
The development build logs warnings for invalid configurations. Use it while building, then switch to the minified version for production.
Pinning a version
Replace latest with a specific version:
https://unpkg.com/blaze-slider@1.0.0/dist/blaze-slider.min.jsFor production, consider self-hosting these files instead of relying on a CDN.