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

ng2-slideshow

v0.0.2

Published

Create customizable Angular2+ Carousel/Slideshow with your own styles

Downloads

4

Readme

Angular Circular Carousel

Create customizable Angular2+ Slideshow/ Carousel that can works as a circular slideshow with no constraints on styles.

Install

npm install ng2-slideshow

Usage

Import CarouselModule into your module

your-module.module.ts

import { CarouselModule } from 'ng2-slideshow';

@NgModule({
  imports: [
    ...
    CarouselModule,
  ],

Import Settings and Image interface into your component class for providing settings configuration and list of Images for your carousel.

your-component.component.ts

import { Settings, Image } from 'ng2-slideshow';
...
export class YourComponent {
  settings: Settings;
  images: Image[];
}

Settings interface

interface Settings { 
    height: String; // Required | Height of carousel in 'px' or percentage.
    width: String; // Required | Width of carousel in 'px' or percentage. 
    carouselDotClass?: String; // Optional | CSS Class for navigator dots at the bottom of carousel, it can be a sprite class or glyphicon or font icon class. If no class is provided, no dots will be shown.
    prevIconClass?: String; // Optional | CSS Class for left navigator icon, it can be a sprite class or glyphicon or font icon class. If no class is provided, no left icon will be shown.
    nextIconClass?: String; // Optional | CSS Class for right navigator icon, it can be a sprite class or glyphicon or font icon class. If no class is provided, no right icon will be shown.
    transitionDuration: Number; // Required | Transition time between bet two slides, animation happens for this duration.
    transitionDelay: Number; // Required | Wait time before automatically move to next slide, i.e animation starts.
}

Image interface

interface Image { 
    caption: String; // Text to display in alt attribute of `img` tag.
    media: String; // Absolute path for your image.
}

It takes two inputs and emits click event to parent component.

Inputs:

images: Image[]; //Required | "Array of images, these images will be displayed in carousel";
settings: Settings; //Required | "Settings for the Carousel"

Now you can use carousel selector in your component template as shown below

your-component.component.html

<ng2-slideshow [IMAGES]="images" [SETTINGS]="settings" (onclick)=handler($event)></ng2-slideshow>

It emits onclick event to the parent component, So there should be an event handler in parent component class. $event omits the 'index' of the image that user has clicked. From this handler, You can navigate user to corresponding page or show modal or something else.

Styling

For styling of carousel, SCSS or CSS can be written as global styles for uniform styling across the project, or you can write styles inside your parent component styles using /deep/ selector.

Note: Please maintain the hierarchy of classes while writing style and don't forget to add /deep/ before .carousel-wrapper in case you are writing styles inside your parent component.

sample.style.scss

.carousel-wrapper {
    ...
    .carousel {
        ....
    }
}

License

MIT © Uttam Pratap Choudhary