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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-swiper-wrapper-gated

v1.0.7

Published

Angular wrapper library for Swiper with swipe gating

Downloads

100

Readme

Angular Swiper Wrapper

This is an Angular wrapper library for the Swiper.

See a live example application here.

Building the library

npm install
npm run build

Running the example

cd example
npm install
npm start

Installing and usage

npm install ngx-swiper-wrapper --save-dev
Load the module for your app (with global configuration):
import { SwiperModule } from 'ngx-swiper-wrapper';
import { SwiperConfigInterface } from 'ngx-swiper-wrapper';

const SWIPER_CONFIG: SwiperConfigInterface = {
  direction: 'horizontal',
  slidesPerView: 'auto',
  keyboardControl: true
};

@NgModule({
  ...
  imports: [
    ...
    SwiperModule.forRoot(SWIPER_CONFIG)
  ]
})
Use it in your html template (with custom configuration):

This library provides two ways to create a Swiper element, simple component and custom directive.

COMPONENT USAGE

Simply replace the element that would oridinarily be passed to Swiper with the swiper component.

<swiper [config]="config" (indexChange)="onIndexChange($event)">
  <div>
    Swiper content
  </div>
</swiper>
[config]            // Custom config to override the global defaults.

(indexChange)       // Event handler for the swiper index change event.

[runInsideAngular]  // Run Swiper function calls inside the angular zone.

DIRECTIVE USAGE

When using only the directive you need to provide your own theming or import the default theme:

@import 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.0/css/swiper.min.css';

Swiper directive can be used in correctly structured div element with optional custom configuration:

<div [swiper]="config" class="swiper-container" (indexChange)="onIndexChange($event)">
  <div class="swiper-wrapper">
    <div class="swiper-slide">
      Swiper content
    </div>
  </div>

  <div class="swiper-scrollbar"></div>

  <div class="swiper-pagination"></div>

  <div class="swiper-button-prev"></div>
  <div class="swiper-button-next"></div>
</div>
[swiper]            // Can be used to provide optional custom config.

(indexChange)       // Event handler for the swiper index change event.

[runInsideAngular]  // Run Swiper function calls inside the angular zone.
Available configuration options (custom / global configuration):
direction           // Direction of the swiper (Default: 'horizontal').
threshold           // Distance needed for the swipe action (Default: 0).
spaceBetween        // Space in pixels between the swiper items (Default: 0).
slidesPerView       // Number of the items per view or 'auto' (Default: 1).
centeredSlides      // Align active item on center not left (Default: false).
keyboardControl     // Enables navigation through arrow keys (Default: false).

For more detailed documentation with all the supported options see swiper documentation.