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-tiny-carousel

v0.7.2

Published

This library is lightweight carousel plugin for Angular.

Downloads

92

Readme

NgxTinyCarousel

This library is lightweight carousel plugin for Angular.

Demo

https://1105-6601.github.io/ngx-tiny-carousel-demo/

Compatibility

| ngx-tiny-carousel | Angular | |-------------------|-----------| | >=0.4.0 | >=14.2.0 |

Installation

Add package.

npm i ngx-tiny-carousel --save

Add Module.

@NgModule({
  //
  imports: [
    //
    NgxTinyCarouselModule,
    //
  ],

  bootstrap: [
    //
  ],
})
export class AppModule
{
}

Usage


<div style="width: 400px;">
  <ngx-tiny-carousel [displayCells]="1">
    <ngx-tiny-carousel-cell>
      ...
    </ngx-tiny-carousel-cell>
    <ngx-tiny-carousel-cell>
      ...
    </ngx-tiny-carousel-cell>
    <ngx-tiny-carousel-cell>
      ...
    </ngx-tiny-carousel-cell>
  </ngx-tiny-carousel>
</div>

Image carousel example

ts

@Component({
  selector:    'app',
  templateUrl: './app.component.html',
})
export class CarouselComponent
{
  public imageSources = [
    'https://picsum.photos/400/400',
    'https://picsum.photos/300/400',
    'https://picsum.photos/250/400',
    'https://picsum.photos/400/250',
    'https://picsum.photos/400/300',
  ];
}

html

<div style="width: 400px;">
  <ngx-tiny-carousel [displayCells]="1">
    <ngx-tiny-carousel-cell *ngFor="let src of imageSources">
      <div class="centralise">
        <img [src]="src" alt="">
      </div>
    </ngx-tiny-carousel-cell>
  </ngx-tiny-carousel>
</div>

scss

.centralise {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

Lazy load content

<ngx-tiny-carousel [displayCells]="1">
  <ngx-tiny-carousel-cell *ngFor="let src of imageSources">
    <div class="centralise" *lazyContent>
      <img [src]="src" alt="">
    </div>
  </ngx-tiny-carousel-cell>
</ngx-tiny-carousel>

API

@Input

| @Input | Type | Required | Default | Description | |------------------------|---------|----------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [displayCells] | number | optional | 1 | Cell count to be displayed at once. | | [cellHeightScale] | number | optional | 1 | Specifies the ratio of the cell height to the cell width. | | [dotPosition] | string | optional | 'inner' | 'inner' or 'outer'. | | [dotStyle] | string | optional | 'dot' | 'dot' or 'bar'. | | [arrowStyle] | string | optional | 'default' | 'default' or 'circle'. | | [uiScale] | number | optional | none | UI scale of dots and arrows. This will be calculated in response to container element height automatically. | | [displayArrows] | boolean | optional | true | Decide to display arrows or not. | | [displayDots] | boolean | optional | true | Decide to display dots or not. | | [enableDrag] | boolean | optional | false | If set true, The carousel becomes draggable. | | [enableInfiniteScroll] | boolean | optional | false | Must be used with the enableDrag option. If set true, The carousel becomes infinite scroll. | | [cellWidth] | number | optional | 0 (auto) | Basically calculated automatically. However, this option may be useful if you nest ngx-tiny-carousel inside a carousel cell that has drag and infinite scroll enabled. | | [virtualCellMargin] | number | optional | 1 | If enableInfiniteScroll is enabled, cell elements are virtualized. In this case, the cells before and after the visible cell can be pre-rendered by the number of cells specified in virtualCellMargin. |

Functions

| Definition | Description | |-------------------------|-------------------------------------------------------------| | next(count: number = 1) | Move to positive direction as much as specified cell count. | | prev(count: number = 1) | Move to negative direction as much as specified cell count. | | jump(cellIndex: number) | Move to specific cell index. |