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 🙏

© 2025 – Pkg Stats / Ryan Hefner

senangwebs-frame

v1.2.2

Published

Lightweight, touch-friendly JavaScript slider library that provides a modern, responsive carousel experience with smooth transitions and intuitive navigation.

Downloads

110

Readme

SenangWebs Learn more at SenangWebs.com

SenangWebs Frame (SWF)

SenangWebs Frame (SWF) is a lightweight, touch-friendly JavaScript slider library that provides a modern, responsive carousel experience with smooth transitions and intuitive navigation. With minimal setup, you can transform your content into an engaging slider with support for multiple items per view, autoplay, and responsive breakpoints.

Features

  • Easy to integrate with existing projects
  • Responsive slider with smooth transitions
  • Support for multiple slides per view
  • Configurable spacing between slides
  • Touch-friendly swipe navigation
  • Autoplay with customizable delay
  • Infinite loop option
  • Customizable via data attributes or JavaScript
  • Built-in navigation controls and indicators
  • Responsive breakpoints support
  • No external dependencies
  • Efficient performance
  • Works on all modern browsers

Installation

Using npm

npm install senangwebs-frame

Using a CDN

You can include SenangWebs Frame directly in your HTML file using unpkg:

<link rel="stylesheet" href="https://unpkg.com/senangwebs-frame@latest/dist/swf.css">
<script src="https://unpkg.com/senangwebs-frame@latest/dist/swf.js"></script>

Usage

  1. Include the SWF CSS and JavaScript files in your HTML:
<!-- If installed via npm -->
<link rel="stylesheet" href="path/to/swf.css">
<script src="path/to/swf.js"></script>

<!-- Or if using unpkg -->
<link rel="stylesheet" href="https://unpkg.com/senangwebs-frame@latest/dist/swf.css">
<script src="https://unpkg.com/senangwebs-frame@latest/dist/swf.js"></script>
  1. Create your slider structure using data attributes:
<div data-swf>
    <div data-swf-items data-swf-autoplay="true" data-swf-infinite="true">
        <div data-swf-item>Slide 1</div>
        <div data-swf-item>Slide 2</div>
        <div data-swf-item>Slide 3</div>
    </div>
    <div data-swf-indicators></div>
    <div data-swf-controls></div>
</div>

The slider will automatically initialize when the page loads.

Configuration Options

Configure your slider using either data attributes or JavaScript initialization:

Data Attributes

  • data-swf: Marks the container element as a slider
  • data-swf-items: Container for slider items
  • data-swf-item: Marks an element as a slider item
  • data-swf-controls: Container for navigation arrows
  • data-swf-indicators: Container for slide indicators
  • data-swf-autoplay="true|false": Enable/disable autoplay
  • data-swf-infinite="true|false": Enable/disable infinite loop
  • data-swf-autoplay-delay="3000": Set autoplay delay in milliseconds
  • data-swf-animation-speed="300": Set transition speed in milliseconds
  • data-swf-start-index="0": Set initial slide index
  • data-swf-responsive: Set responsive breakpoints configuration (JSON string)

JavaScript Initialization

const slider = new SWF(element, {
    autoplay: false,
    infinite: true,
    autoplayDelay: 3000,
    animationSpeed: 300,
    startIndex: 0,
    responsive: [
        {
            breakpoint: 1024,
            slidesPerView: 3,
            spacing: 16
        },
        {
            breakpoint: 768,
            slidesPerView: 2,
            spacing: 12
        },
        {
            breakpoint: 480,
            slidesPerView: 1,
            spacing: 8
        }
    ]
});

Features in Detail

Navigation

  • Touch Controls:
    • Swipe left/right to navigate
    • Touch sensitivity with momentum scrolling
  • Button Controls:
    • Previous/Next buttons
    • Indicator dots for direct slide access
  • Autoplay:
    • Automatic slide progression
    • Pauses on hover/touch
    • Customizable delay

Responsive Design

  • Breakpoint-based configuration
  • Adjustable slides per view
  • Configurable spacing between slides
  • Smooth transitions between breakpoints

Events

The slider emits a swf:change event when slides change, providing the current index and slide element:

slider.container.addEventListener('swf:change', (e) => {
    console.log('Current slide:', e.detail.index);
    console.log('Slide element:', e.detail.slide);
});

Browser Support

SenangWebs Frame works on all modern browsers, including:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • Opera

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • Thanks to all contributors who have helped improve this library

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

Happy sliding!