Skip to content
yfxiePublic

About

A jQuery-free rewrite of slick carousel — same option names, no runtime dependencies, ~8 KB gzipped

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

slickless

A jQuery-free rewrite of slick. Same option names, no runtime dependencies, ~8 KB gzipped.

npm bundle coverage license

Live demo, options, API, recipes →

📖 Languages: English · 繁體中文


Why

Slick is the most-installed carousel of the jQuery era. The behaviour still holds up, but pulling jQuery into a modern bundle just for one widget no longer does.

slick slickless
Dependencies jQuery none
Type declarations community shipped
Touch + mouse + pen separate code paths unified Pointer Events
Resize handling window.resize ResizeObserver
Reduced-motion respect manual built-in
ARIA roles partial full carousel pattern
Gzipped (core + CSS) ~11 kB + jQuery (~24–30 kB) ~8 kB, no deps

Most option names carry straight over: slidesToShow, infinite, fade, centerMode, asNavFor, customPaging, responsive. The DOM uses BEM class names (.slickless__track, .slickless__slide, …) and you construct with new Slickless(el, options). So it's a rename pass, not a drop-in.

Install

bun add slickless
# or
pnpm add slickless
# or
npm install slickless

Use

import { Slickless } from "slickless";
import "slickless/style.css";

const carousel = new Slickless("#my-carousel", {
  slidesToShow: 3,
  dots: true,
  autoplay: true,
});

carousel.on("afterChange", ({ currentSlide }) => {
  console.log("now on", currentSlide);
});
<div id="my-carousel">
  <div>Slide 1</div>
  <div>Slide 2</div>
  <div>Slide 3</div>
</div>

Each direct child becomes a slide. Add data-lazy="…" on <img> to defer image loads.

Documentation

Options, API, events and styling recipes live on the demo:

yfxie.github.io/slickless

Browser support

Modern evergreen browsers (Chrome, Edge, Firefox, Safari ≥ 14). Pointer Events, ResizeObserver and CSS custom properties are required.

Development

bun install
bun run dev          # demo dev server
bun run test         # vitest
bun run build        # library bundle + d.ts
bun run build:demo   # demo build → demo-dist/

License

MIT

About

A jQuery-free rewrite of slick carousel — same option names, no runtime dependencies, ~8 KB gzipped

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages