npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

swift-slider-js

v1.0.4

Published

A modern, lightweight, and dependency-free JavaScript slider for any project.

Readme

Swift Slider 🎞️

A lightweight, modern, responsive, draggable slider built with vanilla JavaScript and CSS.
Supports horizontal/vertical slides, autoplay, arrows, dots, infinite scroll, progress bar, and responsive breakpoints out of the box.


🚀 Installation

You can install via npm:

npm i swift-slider-js

Or include it directly from jsDelivr CDN:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swift-slider-js/dist/swift.min.css">
<script src="https://cdn.jsdelivr.net/npm/swift-slider-js/dist/swift.min.js"></script>

📦 Usage

1. Basic HTML Structure

<div class="slider arrows-slide slider-dots responsive-slides" 
     data-slides="3" 
     data-slides-infinite="true" 
     data-slides-time="3000" 
     data-slides-hover="pause" 
     data-slides-progress="true">
  
  <div class="slider-card">
    <div class="slider-card-content">Slide 1</div>
  </div>
  
  <div class="slider-card">
    <div class="slider-card-content">Slide 2</div>
  </div>
  
  <div class="slider-card">
    <div class="slider-card-content">Slide 3</div>
  </div>

  <!-- Arrows -->
  <button class="slider-arrow slider-arrow-prev">&#10094;</button>
  <button class="slider-arrow slider-arrow-next">&#10095;</button>
</div>

2. Enable Vertical Mode

<div class="slider vertical-slides responsive-slides" data-slides="2">
  <div class="slider-card"><div class="slider-card-content">A</div></div>
  <div class="slider-card"><div class="slider-card-content">B</div></div>
  <div class="slider-card"><div class="slider-card-content">C</div></div>
</div>

3. JavaScript Initialization

No extra setup is required!
The slider auto-initializes on DOMContentLoaded.


⚙️ Options (via data- attributes or classes)

| Attribute / Class | Description | Example | |------------------|-------------|---------| | data-slides="3" | Number of slides to show | 3 | | data-slides-infinite="true" | Infinite loop | true / false | | data-slides-time="3000" | Autoplay interval (ms) | 3000 | | data-slides-hover="pause" | Pause autoplay on hover | pause | | data-slides-mode="center" | Enable center mode | center | | data-slides-progress="true" | Show progress bar | true / false | | data-slides-start="2" | Start from slide index (1-based) | 2 | | data-slides-scroll="2" | Number of slides to scroll | 2 | | data-slides-direction="reverse" | Reverse scroll direction | reverse | | .vertical-slides | Vertical slider | class | | .draggable | Enable drag/swipe | class | | .slider-dots | Show dots navigation | class | | .arrows-slide | Show navigation arrows | class | | .responsive-slides | Enable responsive breakpoints | class |


🎨 Customization

All colors, arrows, dots, and dimensions can be customized with CSS variables:

:root {
  --slider-card-bg: #f0f0f0;
  --slider-arrow-bg: rgba(0,0,0,0.5);
  --slider-dot-color: #ccc;
  --slider-dot-color-active: #7a91ff;
  --slider-progress-color: #7a91ff;
}

📊 Features

✅ Horizontal & Vertical Modes
✅ Infinite Loop / Autoplay / Pause on Hover
✅ Responsive Breakpoints (xs, sm, md, lg, xl, xxl)
✅ Center Mode
✅ Progress Bar
✅ Dots + Arrows Navigation
✅ Drag/Swipe Support
✅ Lightweight – No Dependencies


📜 License

MIT – free to use in personal and commercial projects.