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

ng-smooth-carousel

v14.1.2

Published

A smooth, customizable carousel component for Angular 14 applications

Readme

ng-smooth-carousel

Angular 14 Compatible

A smooth, customizable carousel component for Angular, supporting both vertical and horizontal orientations.

Features

  • 🎯 Smooth scrolling animation ✅
  • 🔄 Flexible orientation support (vertical & horizontal) ✅
  • 🎨 Highly customizable navigation buttons and styling ✅
  • 📱 Responsive design ✅
  • 🎮 Multiple navigation options ✅
  • 🎯 Custom item templates ✅
  • 🔄 Auto-play support ✅
  • 🔄 Full-width single item support ✅
  • 🎨 Custom empty state templates ✅
  • 🎯 Customizable navigation button positions ✅

Coming Soon

  • 🔍 Enhanced search filtering with advanced options ❌
  • ⚡ Click-hold-swap interaction for improved user experience ❌
  • 🔄 Loop functionality ❌

Installation

For Angular 14:

npm install [email protected]

Or with yarn:

yarn add [email protected]

Usage

  1. Import the NgSmoothCarouselModule in your module:
import { NgModule } from '@angular/core';
import { NgSmoothCarouselModule } from 'ng-smooth-carousel';

@NgModule({
  imports: [
    NgSmoothCarouselModule
  ],
  // ...
})
export class YourModule {}
  1. For standalone components:
import { Component } from '@angular/core';
import { NgSmoothCarouselModule } from 'ng-smooth-carousel';

@Component({
  // ...
  standalone: true,
  imports: [NgSmoothCarouselModule]
})
export class YourComponent {}
  1. Use in your template:
<!-- Horizontal Carousel (Default) -->
<nsc [items]="items" [config]="carouselConfig">
  <ng-template #carouselItem let-item>
    <div class="custom-item">
      {{ item.title }}
    </div>
  </ng-template>
</nsc>

<!-- Vertical Carousel -->
<nsc [items]="items" [config]="{ orientation: 'vertical' }">
  <ng-template #carouselItem let-item>
    <div class="custom-item">
      {{ item.title }}
    </div>
  </ng-template>
</nsc>
  1. Configure in your component:
import { Component } from '@angular/core';
import { CarouselConfig } from 'ng-smooth-carousel';

@Component({
  // ...
})
export class YourComponent {
  items = [
    { title: 'Item 1' },
    { title: 'Item 2' },
    // ...
  ];

  carouselConfigs: CarouselConfig = {
    containerWidth: '100%',
    containerHeight: '350px',
    itemWidth: '465px',
    itemHeight: '100%',
    itemGap: '24px',
    scrollSize: '10xl',
    navigationStyle: {
      buttonShape: 'circle',
      nextButton: {
        backgroundColor: '#fff',
        color: '#333',
        boxShadow: '0 2px 8px rgba(0,0,0,0.25)',
        border: '1px solid #333',
        zIndex: '9999',
        position: 'absolute',
        top: '75%',
        right: '10px',
        width: '40px',
        height: '40px',
        transform: 'translateY(-50%)'
      },
      prevButton: {
        backgroundColor: '#fff',
        color: '#333',
        boxShadow: '0 2px 8px rgba(0,0,0,0.25)',
        zIndex: '9999',
        position: 'absolute',
        top: '75%',
        left: '10px',
        width: '40px',
        height: '40px',
        transform: 'translateY(-50%)'
      }
    }
  }
}

Basic Carousel

carouselConfig: CarouselConfig = {
  containerWidth: '100%',
  containerHeight: '300px',
  itemWidth: '400px',
  itemHeight: '100%',
  itemGap: '24px',
  navigationStyle: {
    buttonShape: 'rounded',
  },
};

Example with Custom Empty State Template

<nsc [items]="products" [config]="carouselConfig">
  <!-- Regular item template -->
  <ng-template #carouselItem let-item>
    <div class="custom-item">
      <h3>{{ item.title }}</h3>
      <p>{{ item.description }}</p>
      <button>View Details</button>
    </div>
  </ng-template>

  <!-- Custom empty state template -->
  <ng-template #emptyState>
    <div class="custom-empty-state">
      <h3>No Products Available</h3>
      <p>Please check back later or try a different search.</p>
      <button>Browse All Categories</button>
    </div>
  </ng-template>
</nsc>

The carousel component will use your custom empty state template when there are no items to display, such as when filtering returns no results or when the provided items array is empty.

Configuration Options

Basic Configuration

| Property | Type | Default | Description | |----------|------|---------|-------------| | containerWidth | string | '100%' | Width of the carousel container | | containerHeight | string | 'auto' | Height of the carousel container | | itemWidth | string | '200px' | Width of each carousel item | | itemHeight | string | '100%' | Height of each carousel item | | itemGap | string | '0px' | Gap between carousel items | | showNavigation | boolean | true | Show/hide navigation buttons | | orientation | 'horizontal' | 'vertical' | 'horizontal' | Carousel orientation | | animationDuration | string | '300ms' | Duration of scroll animation | | animationTiming | string | 'ease' | Timing function for animation | | contentPadding | string | '10px' | Padding for the content area | | navigationSize | string | '60px' | Size of navigation areas | | navigationPadding | string | '10px' | Padding for navigation areas | | ctaPosition | string | 'bottom-right' | Position of navigation controls |

Advanced Features

| Property | Type | Default | Description | |----------|------|---------|-------------| | autoplay | boolean | false | Enable autoplay ✅ | | autoplayDelay | string | '3000ms' | Delay between autoplay slides ✅ | | loop | boolean | false | Enable infinite loop ❌ | | enableSearch | boolean | false | Enable search functionality | | searchPlaceholder | string | 'Search...' | Placeholder text for search input ❌ | | searchModalTitle | string | 'Search Items' | Title for search modal ❌ | | enableOneItemScroll | boolean | false | Enable scrolling one item at a time ✅ |

Full-Width Single Item Carousel

To create a carousel that displays and scrolls through one full-width item at a time (common for hero sliders or product showcases), use the following configuration:

carouselConfig: CarouselConfig = {
  containerWidth: '100%',
  containerHeight: '350px',
  itemWidth: '100%',
  itemHeight: '100%',
  enableOneItemScroll: true,
  navigationStyle: {
    buttonShape: 'rounded',
    nextButton: {
      backgroundColor: '#fff',
      color: '#333',
      boxShadow: '0 2px 8px rgba(0,0,0,0.25)',
      top: '75%',
      right: '-2px',
      width: '40px',
      height: '60px',
      transform: 'translateY(-50%)'
    },
    prevButton: {
      backgroundColor: '#fff',
      color: '#333',
      boxShadow: '0 2px 8px rgba(0,0,0,0.25)',
      top: '75%',
      left: '-2px',
      width: '40px',
      height: '60px',
      transform: 'translateY(-50%)'
    }
  }
}

This configuration creates a clean, full-width carousel where each item takes up the entire container width and scrolls individually.

Scroll Sizes

The scrollSize property accepts the following values, each moving by a specific number of pixels:

type ScrollSize = 
  | 'xs'   // 50px
  | 'sm'   // 100px
  | 'md'   // 150px
  | 'lg'   // 200px
  | 'xl'   // 250px
  | '2xl'  // 300px
  | '3xl'  // 350px
  | '4xl'  // 400px
  | '5xl'  // 450px
  | '6xl'  // 500px
  | '7xl'  // 550px
  | '8xl'  // 600px
  | '9xl'  // 650px
  | '10xl' // 700px

Button Shapes

The buttonShape property in navigationStyle accepts:

type NavButtonShape = 'circle' | 'rounded' | 'square';

NavigationStyle Interface

interface NavigationStyle {
  nextButton?: Record<string, string> | ButtonStyle;
  prevButton?: Record<string, string> | ButtonStyle;
  buttonShape?: NavButtonShape;
  icons?: {
    next?: string;
    prev?: string;
    search?: string;
    vertical?: {
      next?: string;
      prev?: string;
    };
  };
}

ButtonStyle Interface

interface ButtonStyle {
  backgroundColor?: string;
  color?: string;
  borderRadius?: string;
  padding?: string;
  fontSize?: string;
  border?: string;
  boxShadow?: string;
  top?: string;
  bottom?: string;
  left?: string;
  right?: string;
  zIndex?: string;
  transform?: string;
  position?: string;
} 

SearchStyle Interface

interface SearchStyle {
  button?: Record<string, string>;
  modal?: Record<string, string>;
}

Angular Version Compatibility

| Angular Version | Package Version | |-----------------|-----------------| | Angular 14 | 14.1.0 | | Angular 17+ | Coming soon |

Demo

Horizontal

Single Item Multiple Items

Vertical

Single Item Multiple Items

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

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

License

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

Support

For support, please create an issue in the GitHub repository.

Changelog

See CHANGELOG.md for a list of changes and updates.