Guide · Zero dependencies

A zero-dependency carousel in 16.6 kB gzipped

"Zero dependencies" is a promise about what your package manager installs and what your users download. Here is exactly what Zikra Slider Pro costs, what those bytes buy, and where the trade-offs are.

Updated 2026-11-227 min readLive demo

What zero dependencies means here

  • No runtime dependencies. package.json has no dependencies field; nothing is installed alongside the engine.
  • One script and one stylesheet. The UMD build exposes window.zikraslider; the ESM build exports the same factory.
  • Optional libraries stay optional. GSAP, anime.js and Motion One are detected at runtime, never bundled and never fetched by the package.
  • React is an optional peer, used only by the wrapper at zikra-slider-pro/react.

The bill of materials

FileMinifiedGzipped
dist/zikraslider.min.js60.2 kB16.6 kB
dist/zikra-slider.css6.1 kB1.9 kB
Total required66.3 kB18.5 kB
Runtime dependencies0

Measured for 1.3.3 with the project's esbuild pipeline and gzip. The JavaScript number includes every layout and the built-in arrows, bullets and progress bar — there are no optional modules to add later.

What the bytes buy

7 layoutsslide, fade, scale, coverflow, stack, cards and a custom transform.
Accessibility defaultsroles, labels, live region, inert off-screen slides, keyboard, reduced motion.
Runtime APIsappendSlide, prependSlide, removeSlide, update, sync and destroy.

Also included: parallax captions, thumbnail sync, free-mode drag with momentum, wheel navigation, autoplay, responsive breakpoints, RTL, lazy-image handling, TypeScript declarations and a React component. The engine is small because it has one compute pass and one transition plan — not because features are missing behind a paywall of extra imports.

What you give up

  • Tree-shaking. One ESM file means unused layouts still ship. If you want a 5 kB primitive and will build your own controls, Embla or Keen Slider is a better fit.
  • Virtual slides. Every slide is in the DOM, which is fine for dozens, not for thousands.
  • Framework wrappers beyond React. Vue and Next.js examples are provided, but only React ships as an official wrapper.
  • A large ecosystem. It is a new, single-maintainer project; the big libraries have years of Stack Overflow answers.

Three ways to load it

# npm
npm install zikra-slider-pro

// ESM
import zikraslider from 'zikra-slider-pro';
import 'zikra-slider-pro/css';

<!-- script tag (UMD) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zikra-slider-pro@1.3.3/dist/zikra-slider.css">
<script src="https://cdn.jsdelivr.net/npm/zikra-slider-pro@1.3.3/dist/zikraslider.min.js"></script>

The animation ladder

With animation.library: 'auto' (the default), the engine looks for GSAP, then anime.js, then Motion One. If none is present it uses Element.animate (WAAPI), and if that is unavailable it uses CSS transitions. The same from/to plan drives every backend, so falling back is a strategy swap rather than a rewrite. Read the exact options in the Engines section of the demo.

Try the single-file build

This slider is initialized by the UMD build already loaded by this page:

Layered teal artwork

18.5 kB gzipped

engine plus stylesheet

Layered amber artwork

No npm install

one script tag, one stylesheet

Layered indigo artwork

No fetch at runtime

optional engines are never downloaded

zikraslider('#zd-demo', {
  type: 'slide',
  loop: true,
  speed: 460
});

Frequently asked questions

Does the carousel require GSAP, anime.js or Motion One?

No. The animation ladder uses GSAP, anime.js or Motion One only when one is already present, then falls back to the Web Animations API and finally to CSS transitions. Those libraries are never bundled or downloaded by the package.

Is React a dependency of the carousel?

Only for the wrapper. React is an optional peer dependency used by zikra-slider-pro/react. The core engine is plain JavaScript and never imports React.

How is the 16.6 kB figure measured?

It is the gzipped size of dist/zikraslider.min.js, which is 60.2 kB minified and includes all seven layouts and built-in controls. The required stylesheet adds 1.9 kB gzipped. Measured for version 1.3.3.

Can I use it without a build step?

Yes. Load dist/zikraslider.min.js and dist/zikra-slider.css from a CDN, then call the global zikraslider function. This demo site does exactly that; no bundler is involved.